sqlite_async
0.14.8, released 2 weeks ago by powersync.com
High-performance asynchronous SQLite interface for Dart and Flutter.
What it does
Wraps SQLite bindings to provide asynchronous database operations, concurrent read/write transactions, WAL mode configuration, and query watching without blocking the main isolate.
AI-written summary of version 0.14.8, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need direct SQL query access without code generation overhead.
- Your app requires high-performance concurrent read and write transactions.
- You want to automatically watch and re-run queries on data changes.
Skip it when
- You prefer a heavily typed ORM or object-relational mapping tool with code generation.
- You only need simple key-value storage rather than a relational database.
Strengths
- Asynchronous operations by default to prevent UI jank.
- Supports concurrent transactions with WAL mode enabled.
- Built-in query watching capabilities.
Weaknesses
- Web support requires additional configuration of WASM and web worker assets.
- Does not use code generation or model classes by default, requiring manual mapping from raw SQL results.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Dart pub add sqlite_async. Web support requires access to sqlite3.wasm and db_worker.js files.
import 'package:sqlite_async/sqlite_async.dart';
void main() async {
final db = SqliteDatabase(path: 'test.db');
await db.execute('CREATE TABLE IF NOT EXISTS test_data(id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT)');
await db.execute('INSERT INTO test_data(data) values(?)', ['Test1']);
var results = await db.getAll('SELECT * FROM test_data');
print('Results: $results');
await db.close();
}Alternatives
Packages that do the same job and could replace sqlite_async.
- drift
Choose drift if you prefer type-safe queries, relational mapping, and reactive streams via code generation.
99Compare - sqflite
Choose sqflite if you need the traditional SQLite plugin for Flutter with broad legacy usage.
96Compare - hive_ce
Choose hive_ce if you want a fast NoSQL key-value database instead of relational SQL.
96Compare
Works with
Packages commonly used together with sqlite_async: ones it builds on, ones built on it, and its own family.
- websqlite_async depends on itLightweight bindings for browser APIs via JS interop
- asyncsqlite_async depends on itUtility classes and helpers that extend Dart's async library.
- sqlite3sqlite_async depends on itLightweight and convenient SQLite bindings for Dart using dart:ffi
- sqlite3_websqlite_async depends on itAsync SQLite access on the web via workers with automatic storage detection
- powersyncBuilt on sqlite_asyncPowerSync Dart and Flutter SDK. Sync Postgres, MongoDB, MySQL or SQL Server with SQLite in your app
- drift_sqlite_asyncBuilt on sqlite_asyncUse Drift with a sqlite_async database in the same application.