I'd like to embed a read only database to our iOS ...
# squarelibraries
p
I'd like to embed a read only database to our iOS and Android apps. Would reverse engineering the path sqldelight users and moving the file there before touching the sqldelight database classes be the way to go?
👀 1
g
On Android at least, you can open a connection to the database at any location you want, and pass the existing connection to the driver.
AndroidSqliteDriver
has a constructor which takes an existing
SupportSQLiteDatabase
as an argument. I haven’t looked but I assume iOS can do something similar?
We use that to prevent SQLDelight from running the table creation/migration queries as that is all handled separately by pre-existing logic in our codebase. All we want from SQLDelight is the ability to read from an existing database.
👍 1