Skip to content
pubscout

idb_sqflite

1.5.3, released 11 days ago by tekartik.com

IndexedDB API implementation on top of sqflite for Flutter and Dart VM

WASM-ready
$ flutter pub add idb_sqflite
Source repository

What it does

Provides an IndexedDB-compatible database interface built on top of sqflite, enabling code to use IndexedDB patterns across mobile, web, and desktop platforms. It also includes a simplified wrapper API called SDB.

AI-written summary of version 1.5.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need an IndexedDB-compatible API sharing code across web, mobile, and desktop
  • You want to store structured data locally using sqflite as the backend engine

Skip it when

  • You need a high-performance native ORM or complex relational SQL queries
  • You prefer standard sqflite or drift APIs over IndexedDB concepts

Strengths

  • Brings IndexedDB API support to mobile and desktop via sqflite
  • Works across Android, iOS, Web, Windows, macOS, and Linux

Weaknesses

  • Performance is constrained by running an IndexedDB emulation layer over SQLite
  • API style follows IndexedDB rather than native Dart/SQL idioms

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5
import 'package:idb_sqflite/idb_sqflite.dart';
import 'package:sqflite/sqflite.dart';

Future main() async {
  var factory = getIdbFactorySqflite(databaseFactory);
  const String storeName = "records";
  Database db = await factory.open("my_records.db", version: 1,
      onUpgradeNeeded: (VersionChangeEvent event) {
    Database db = event.database;
    db.createObjectStore(storeName, autoIncrement: true);
  });
  var txn = db.transaction(storeName, idbModeReadWrite);
  var store = txn.objectStore(storeName);
  var key = await store.put({"some": "data"});
  await txn.completed;
}

Alternatives

Packages that do the same job and could replace idb_sqflite.

  • drift

    If you want a robust, type-safe reactive SQL database library for Flutter.

  • hive_ce

    If you are looking for a fast, lightweight NoSQL key-value database.

Works with

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