This demo shows how you can migrate a Web SQL database over to SQLite Wasm database.
To debug, open Chrome DevTools on the "Application" tab and check the "Web SQL" section. For debugging the OPFS, you can install the OPFS Explorer Chrome DevTools extension.
There is no way to programmatically delete a Web SQL database. You can only ask the user to clear site data in DevTools, or even to delete the database manually with the file explorer.
This step creates a Web SQL database with sample data.
This step shows the SQL statements required to dump the data from Web SQL.
This step runs each SQL statement from above to migrate the data from Web SQL to SQLite, persisted on the OPFS.
(⚠️ Warning: this example deletes any other data that may exist on the OPFS.)
This steps deletes all tables in the Web SQL database after the migration.