Duckdb
DuckDB integration for swamp: query model for ad-hoc SQL, and a datastore backend that stores swamp runtime data in a DuckDB database file with row-based distributed locking. Embedded, local-only — no network dependency.
Model
Run SQL queries against local DuckDB databases, list tables, inspect schemas, and export query results as structured data resources.
bash swamp model create @zocc/duckdb mydb swamp model method run mydb list_tables --input database=/path/to/data.duckdb swamp model method run mydb query --input database=/path/to/data.duckdb --input sql="SELECT * FROM t LIMIT 10" swamp model method run mydb summarize --input database=/path/to/data.duckdb
Datastore
Use DuckDB as the storage backend for swamp runtime data.
type: "@zocc/duckdb"
config:
database: "/path/to/swamp.duckdb"
schema: "swamp"bash export SWAMP_DATASTORE='@zocc/duckdb:{"database":"/data/swamp.duckdb"}'
Required Tools
duckdbCLI (https://duckdb.org/)
| Argument | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file |
| Argument | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file |
| sql | string | SQL query to execute |
| limit | number | Maximum number of rows to return (0 = unlimited) |
| Argument | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file |
| Argument | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file |
| source | string | Path or URL to the source file (CSV, JSON, NDJSON, or Parquet) |
| table | string | Target table name to import into |
| format | string | Source format: csv, json, ndjson, parquet, or auto (detect from extension) |
| create_table | boolean | CREATE TABLE IF NOT EXISTS before importing |
| delimiter | string | Column delimiter for CSV files (default: comma) |
| header | boolean | Whether the source CSV has a header row |
| Argument | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file |
| destination | string | Output file path (extension determines format: .csv, .json, .parquet) |
| sql? | string | SQL query to export (use instead of table) |
| table? | string | Table name to export (use instead of sql) |
| format | string | Output format: csv, json, parquet, or auto (detect from destination extension) |
| delimiter | string | Column delimiter for CSV output (default: comma) |
| header | boolean | Whether to include header row in CSV output |
Resources
Stores swamp runtime data in a DuckDB database file with row-based distributed locking. Embedded, local-only — no network dependency.
Config Fields
| Field | Type | Description |
|---|---|---|
| database | string | Path to the DuckDB database file. Use ':memory:' for an in-memory database. |
| schema | string | DuckDB schema for swamp tables |
| accessMode | enum | Database access mode: read_write (default) or read_only |
v2026.05.21.3: DuckDB query model + datastore backend
Model methods: list_tables, query, summarize, import_data, export_data Datastore: embedded runtime storage with nonce-based locking Formats: CSV, JSON, NDJSON, Parquet (import + export) Platforms: linux-x86_64, linux-aarch64, darwin-x86_64, darwin-aarch64
Not yet scored.
A score will be generated the next time this extension is published. The owner can also trigger scoring manually.