Join Slack
Powered by
Can I use SQLDelight SQLite/JS with a pre-existing...
# squarelibraries
t
Tianyu Zhu
08/05/2023, 11:00 PM
Can I use SQLDelight SQLite/JS with a pre-existing SQLite db file?
d
Derek Ellis
08/06/2023, 10:08 PM
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
Derek Ellis
08/06/2023, 10:09 PM
The
new SQL.Database();
call accepts a byte array representing your db file
https://sql.js.org/documentation/Database.html#Database
Open in Slack
Previous
Next