Skip to content

Migrate from deprecated duckdb binding to @duckdb/node-api (DuckDB 1.5.x)#23

Open
piotrszul wants to merge 2 commits into
masterfrom
issue/22_migrate-to-duckdb-1.5
Open

Migrate from deprecated duckdb binding to @duckdb/node-api (DuckDB 1.5.x)#23
piotrszul wants to merge 2 commits into
masterfrom
issue/22_migrate-to-duckdb-1.5

Conversation

@piotrszul

Copy link
Copy Markdown
Collaborator

Closes #22.

Migrates flatquack off the deprecated duckdb Node binding onto the modern @duckdb/node-api, which also moves the bundled DuckDB engine from 1.4.x → 1.5.x.

Changes

  • Dependency: duckdb ^1.4.1@duckdb/node-api ^1.5.2-r.1 (package.json, lockfile).
  • src/cli.js: swap the callback new duckdb.Database() API for the promise-based DuckDBInstance.create() / instance.connect(). runQuery / exploreQuery are now async (awaited at call sites); rows read via runAndReadAll().getRowObjectsJS(); cleanup via instance.closeSync() in finally.
  • tests/test-util.js: openMemoryDb / getColumns / executeQuery now async over a small DuckDBConn wrapper; column introspection moves from stmt.columns() to result.columnNames().
  • Test suites (e2e, fp, fp-custom, schema, spec, anonymize-macros) updated to await the now-async helpers.

Verification

bun test191 pass, 0 fail (249 expect() calls, 7 files) on DuckDB 1.5.x.

Note

The 1.4 → 1.5 engine bump changes runtime behaviour, not just the API surface — see #19 (struct backend perf regression on 1.5.x) for engine-version-sensitive follow-up.

🤖 Generated with Claude Code

piotrszul and others added 2 commits April 29, 2026 13:07
The old `duckdb` package has no pre-built binaries for Node 25+ and
was not released for DuckDB v1.5+. Migrates to `@duckdb/node-api`
(Node Neo) throughout src and tests, converting callbacks to async/await
and using getRowObjectsJS() for plain JS type coercion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract withMemoryConnection() in cli.js so runQuery/exploreQuery
  no longer duplicate instance/connect/try-finally boilerplate
- Add public DuckDBConn.columns(); getColumns no longer reaches into
  the private _conn field
- Parameterize openMemoryDb(macroSql); anonymize-macros.test.js now
  reuses it instead of reimplementing instance/connection setup

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from deprecated duckdb binding to @duckdb/node-api (DuckDB 1.5.x)

1 participant