Skip to content
pubscout

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
$ flutter pub add sqflite_common_ffi_web
Source repository

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.

  • drift

    A reactive SQLite database for Dart and Flutter with robust multi-platform support including web.

Works with

Packages commonly used together with sqflite_common_ffi_web: ones it builds on, ones built on it, and its own family.