Open BinaryShrub opened 9 months ago
At the moment this is fairly complicated because there is no uniform file system API on the web, so drift implements a number of approaches. But drift's file system implementation is not part of the public API.
I think you can do imports by using WasmDatabase.probe
and then calling deleteDatabase
on an existing database and using open
with an initializeDatabase
function resolving to the blobs to import.
I need to open a Web database with the bytes of an SQLite file. I'm trying to use the initializeDatabase
property, in the Native opener is working, and the Wasm opener is not. It is possible to open a web database with SQLite file bytes?
Yes, this should work - we have integration tests covering this too (they're loading an asset from an URL like this):
This method is passed to the initializeDatabase
property which should work. Could it be that the database already exists in the browser, it's just not properly initialized?
Looking to offer a backup/restore option (that I plan to integrate with Google Drive API) for automated periodic backups. I read https://drift.simonbinder.eu/docs/examples/existing_databases/ but it seems to be targeted for
NativeDatabase
How can I achieve backup and restore when targeting web and all the possible fallbacks?