|
Hello drift team, Thanks 🙏 |
Answered by
simolus3
Feb 9, 2026
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. |
0 replies
Answer selected by
mohanedy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to 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
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.