Migrate from deprecated duckdb binding to @duckdb/node-api (DuckDB 1.5.x)#23
Open
piotrszul wants to merge 2 commits into
Open
Migrate from deprecated duckdb binding to @duckdb/node-api (DuckDB 1.5.x)#23piotrszul wants to merge 2 commits into
piotrszul wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22.
Migrates flatquack off the deprecated
duckdbNode binding onto the modern@duckdb/node-api, which also moves the bundled DuckDB engine from 1.4.x → 1.5.x.Changes
duckdb ^1.4.1→@duckdb/node-api ^1.5.2-r.1(package.json, lockfile).src/cli.js: swap the callbacknew duckdb.Database()API for the promise-basedDuckDBInstance.create()/instance.connect().runQuery/exploreQueryare nowasync(awaited at call sites); rows read viarunAndReadAll().getRowObjectsJS(); cleanup viainstance.closeSync()infinally.tests/test-util.js:openMemoryDb/getColumns/executeQuerynow async over a smallDuckDBConnwrapper; column introspection moves fromstmt.columns()toresult.columnNames().e2e,fp,fp-custom,schema,spec,anonymize-macros) updated toawaitthe now-async helpers.Verification
bun test— 191 pass, 0 fail (249expect()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