dart_duckdb
1.4.4, released 12 months ago by tigereye.com
Native Dart interface to the DuckDB analytical database system
What it does
Provides a Dart-native API to interact with DuckDB across macOS, iOS, Android, Linux, Windows, and Web. It allows developers to run high-performance SQL analytical queries, read Parquet, CSV, and JSON files directly without importing data, and utilize window functions.
AI-written summary of version 1.4.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a high-performance analytical database embedded in your Dart or Flutter application
- You want to query large datasets, CSV, or Parquet files directly from local storage or memory
- You require a self-contained SQL database without external database servers
Skip it when
- You are looking for a simple key-value store rather than a full OLAP SQL engine
- You want a lightweight database and want to avoid the binary footprint of DuckDB
Strengths
- High performance powered by DuckDB's vectorized query engine
- Cross-platform support including macOS, iOS, Android, Linux, Windows, and Web
- Supports direct file access for formats like Parquet, CSV, and JSON
Weaknesses
- Requires platform-specific binary setup or WASM script imports for web
- Larger binary size compared to simple key-value database alternatives
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 10
Requires downloading DuckDB releases and overriding the binary path or adding WASM script imports in index.html for web support.
Future<void> main() async {
final db = await duckdb.open(":memory:");
final conn = await duckdb.connect(db);
await conn.execute("CREATE TABLE users (id INTEGER, name VARCHAR)");
await conn.execute("INSERT INTO users VALUES (1, 'Alice')");
final result = await conn.query("SELECT * FROM users");
for (final row in result.fetchAll()) {
print(row);
}
await conn.dispose();
await db.dispose();
}Alternatives
Packages that do the same job and could replace dart_duckdb.
- sqflite
SQLite plugin for Flutter supporting iOS, Android and MacOS.
96Compare - sqflite_common
Dart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
93Compare - sqlite3
Lightweight and convenient SQLite bindings for Dart using dart:ffi
92Compare - sqflite_common_ffi_web
Sqflite web implementation using sqlite3 ffi and sqlite3 wasm.
90Compare
Works with
Packages commonly used together with dart_duckdb: ones it builds on, ones built on it, and its own family.
- uuiddart_duckdb depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- webdart_duckdb depends on itLightweight bindings for browser APIs via JS interop
- asyncdart_duckdb depends on itUtility classes and helpers that extend Dart's async library.
- ffidart_duckdb depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- intldart_duckdb depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- loggingdart_duckdb depends on itProvides configurable logging with levels and stream listeners for Dart apps.