-
|
Hello drift team, Thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Drift opens connections lazily when the first statement on the database runs. So an easy way to explicitly open the connection is to await a cheap statement like
You can wrap your existing connection in a LazyDatabase which invokes a callback when the connection is opened. |
Beta Was this translation helpful? Give feedback.
Drift opens connections lazily when the first statement on the database runs. So an easy way to explicitly open the connection is to await a cheap statement like
db.customSelect('SELECT 1').get(). You can also calldb.doWhenOpenedwith an empty callback to force this.You can wrap your existing connection in a LazyDatabase which invokes a callback when the connection is opened.