Is there a way we can bundle custom sqlite build f...
# squarelibraries
s
Is there a way we can bundle custom sqlite build for android/iOS in SQLDelight? Please point me to some documentation/writeup that can help with setting it up Context: Used in a library that target js/ios/android where idb will be used for js and sqlite for iOS/android Cannot rely on sqlite provided by platform since I want a standardised version of sqlite for both targets
e
Yes, you can use https://github.com/eygraber/sqldelight-androidx-driver and add support for js+idb on your side.
s
Nice! How do I control the sqlite version being bundled here? And since it’s bundled now do I still need the expect/actual DriverFactory setup as done in SQLDelight docs? from what I understand, don’t really need any platform specific code if bundling sqlite in project itself
e
If you use the latest version of the
BundledSQLiteDriver
it should have a fairly recent version of SQLite, if not the latest. You'll probably need to expect/actual for js, but for ios and Android you just use
AndroidxSqliteDriver
There an issue you can track for documenting the version of SQLite used with
BundledSQLiteDriver
s
Thanks! trying it out rn any implementation gotchas I should know about compared to drivers provided by sqldelight? as this will go in production for a reasonably big app
e
There are some notes in the README about connection pooling. If you're using WAL you'll probably want a 4 member thread pool / coroutine dispatcher for reads, and a single member thread pool / coroutine dispatcher for writes to get the best performance. Other than that, I'm using it with no issues in a greenfield app that isn't in production yet. No known issues.
👍 1
s
Thanks