Skip to content
Discussion options

You must be logged in to vote

Is it possible to await for the sqlite drift connection

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 call db.doWhenOpened with an empty callback to force this.

or have any kind of callback when the connection is opened

You can wrap your existing connection in a LazyDatabase which invokes a callback when the connection is opened.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mohanedy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants