Can I use SQLDelight SQLite/JS with a pre-existing...
# squarelibraries
t
Can I use SQLDelight SQLite/JS with a pre-existing SQLite db file?
d
It's possible, but not with the default web worker scrips that are currently provided. For example you can copy and modify the SQL.js worker to import your db file when the database instance is created: https://github.com/cashapp/sqldelight/blob/master/drivers/web-worker-driver/sqljs/sqljs.worker.js
The
new SQL.Database();
call accepts a byte array representing your db file https://sql.js.org/documentation/Database.html#Database