Skip to content
pubscout

dart_duckdb

1.4.4, released 12 months ago by tigereye.com

Native Dart interface to the DuckDB analytical database system

WASM-ready
$ flutter pub add dart_duckdb
Source repository

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.

Works with

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