2021-10-27 12:25:32 -07:00
|
|
|
// ignore: avoid_web_libraries_in_flutter
|
|
|
|
import 'dart:html';
|
|
|
|
|
|
|
|
import 'package:drift/web.dart';
|
2023-04-10 13:58:15 -07:00
|
|
|
import 'package:drift/web/worker.dart';
|
2021-10-27 12:25:32 -07:00
|
|
|
|
|
|
|
void main() {
|
2023-04-10 13:58:15 -07:00
|
|
|
WorkerGlobalScope.instance.importScripts('sql-wasm.js');
|
2021-10-27 12:25:32 -07:00
|
|
|
|
2023-04-10 13:58:15 -07:00
|
|
|
driftWorkerMain(() {
|
|
|
|
return WebDatabase.withStorage(DriftWebStorage.indexedDb('worker',
|
|
|
|
migrateFromLocalStorage: false, inWebWorker: true));
|
2021-10-27 12:25:32 -07:00
|
|
|
});
|
|
|
|
}
|