sqflite_common_ffi_web
1.2.2, released 11 days ago by tekartik.com
Sqflite web implementation using sqlite3 ffi and sqlite3 wasm.
WASM-readyRock solid
What it does
Provides a web implementation for sqflite using sqlite3 ffi and sqlite3 wasm. Enables persisting data in IndexedDB and running database operations in a shared worker.
AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to use sqflite in Flutter web applications
- You want persistent SQL storage in the browser using IndexedDB
Skip it when
- You need multiple connections to the same database file (singleInstance: false is not supported)
- You want a fully stable, non-experimental web database solution
Strengths
- Persistency in indexeddb
- Cross-tab safe via shared worker
- Wasm compatible
Weaknesses
- Experimental status
- Slow performance
- Single connection per database limit (no singleInstance: false)
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 12
Requires adding sqlite3.wasm binaries and a sqflite specific shared worker to your web folder using the setup command 'dart run sqflite_common_ffi_web:setup'.
var factory = databaseFactoryFfiWeb;
var db = await factory.openDatabase('my_db.db');
var sqliteVersion = (await db.rawQuery('select sqlite_version()')).first.values.first;Alternatives
Packages that do the same job and could replace sqflite_common_ffi_web.
Works with
Packages commonly used together with sqflite_common_ffi_web: ones it builds on, ones built on it, and its own family.
- pub_semversqflite_common_ffi_web depends on itVersions and version constraints implementing pub's versioning policy.
- websqflite_common_ffi_web depends on itLightweight bindings for browser APIs via JS interop
- argssqflite_common_ffi_web depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- synchronizedsqflite_common_ffi_web depends on itLock mechanism to prevent concurrent access to asynchronous code.
- sqflite_commonsqflite_common_ffi_web depends on itDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sqlite3sqflite_common_ffi_web depends on itLightweight and convenient SQLite bindings for Dart using dart:ffi
- sqflite_common_ffisqflite_common_ffi_web depends on itFFI-based implementation of sqflite for desktop platforms and unit tests.
- process_runsqflite_common_ffi_web depends on itRun shell scripts and locate executables across Linux, Windows and macOS.