fix: drift not working on web

This commit is contained in:
PartyDonut 2025-08-08 18:11:40 +02:00
parent fa30e634b4
commit d3505e99b7
4 changed files with 13334 additions and 1 deletions

1
.vscode/launch.json vendored
View file

@ -81,6 +81,7 @@
"args": [ "args": [
"--web-port", "--web-port",
"9090", "9090",
"--web-experimental-hot-reload",
], ],
}, },
{ {

View file

@ -199,7 +199,10 @@ class AppDatabase extends _$AppDatabase {
native: const DriftNativeOptions( native: const DriftNativeOptions(
databaseDirectory: getApplicationSupportDirectory, databaseDirectory: getApplicationSupportDirectory,
), ),
// If you need web support, see https://drift.simonbinder.eu/platforms/web/ web: DriftWebOptions(
sqlite3Wasm: Uri.parse('sqlite3.wasm'),
driftWorker: Uri.parse('drift_worker.dart.js'),
),
); );
} }
} }

13329
web/drift_worker.dart.js Normal file

File diff suppressed because one or more lines are too long

BIN
web/sqlite3.wasm Normal file

Binary file not shown.