Skip to content

Update to latest DuckDB packages#3245

Merged
archiewood merged 23 commits intoevidence-dev:mainfrom
ebardelli:update_duckdb
Nov 14, 2025
Merged

Update to latest DuckDB packages#3245
archiewood merged 23 commits intoevidence-dev:mainfrom
ebardelli:update_duckdb

Conversation

@ebardelli
Copy link
Contributor

Description

The DuckDB packages have been updated to their latest versions:

  • @duckdb/node-api to version 1.4.2
  • @duckdb/duckdb-wasm to version 1.31.1-dev1.0

duckdb-async has been replaced with duckdb/node-api. This led to some changes in how queries
are run and how results are processed. The new duckdb/node-api package offers improved performance
and follows the same release schedule as the main DuckDB project. duckdb-async will be discontinued in
about 6 months.

Additional tests have been added to ensure that semicolons inside block comments do not split SQL
statements incorrectly.

The new packages work on my production site. There might be remaining bugs with the duckdb/node-api implementation, but I haven't run into them yet.

The duckdb-wasm update is a drop-in replacement for the old one.

Checklist

  • For UI or styling changes, I have added a screenshot or gif showing before & after
  • I have added a changeset
  • I have added to the docs where applicable
  • I have added to the VS Code extension where applicable

@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 12, 2025 17:35 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 12, 2025 18:31 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 12, 2025 20:27 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 12, 2025 23:04 — with GitHub Actions Failure
@archiewood
Copy link
Member

huge PR, thank you!

Copy link
Member

@archiewood archiewood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of two changes

  • Relatively low risk: Upgrade the DuckDB connector to use the node-api. This only affects the DuckDB connector and the writing of parquet files using that.

  • Relatively high risk: Upgrade WASM. This impacts the SQL runtime for the whole of Evidence and merits some careful checking

@ebardelli
Copy link
Contributor Author

This is kind of two changes

  • Relatively low risk: Upgrade the DuckDB connector to use the node-api. This only affects the DuckDB connector and the writing of parquet files using that.
  • Relatively high risk: Upgrade WASM. This impacts the SQL runtime for the whole of Evidence and merits some careful checking

I think that the risk is kind of flipped.

The WASM update is a drop-in replacement and stuff just works (as far as I can tell). I have been running the new WASM packages for some time now and nothing has broken.

The switch to node-api was more of a pain to make it work. Beside the small change from Database to DuckDBInstance, it broke a bunch of other stuff because of how results are returned. The new tests address all the issues I ran into in my deployment. There might be other hedge cases that I haven't experienced, but I'm doing some weird stuff with my duckdb connector, so I'm feeling pretty confident that I'm catching most of the issues. The only thing that comes to mind that I haven't tried if using TEMP TABLES in a query.

@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 13, 2025 19:40 — with GitHub Actions Inactive
@ebardelli
Copy link
Contributor Author

I pushed a new commit that uses the stable releases as of today.

  • @duckdb/node-api uses version 1.4.2-r.1. I think they are doing .patch now?
  • @duckdb/duckdb-wasm to version 1.30.0. This uses an older version of duckdb, but that's what it's tagged as current on npmjs, even if they released 1.31.0 without a dev tag. 🤷

@archiewood
Copy link
Member

archiewood commented Nov 13, 2025

looks like you need to regenerate the lockfile

version 1.30.0. This uses an older version of duckdb

How old we talking? WASM sometimes lags duckdb

I think that the risk is kind of flipped.

I guess I was thinking more about the risk to the product as a whole. Impacting the duckdb connector vs impacting the runtime. I take your point around the complexity

@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 13, 2025 20:43 — with GitHub Actions Failure
@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 13, 2025 20:47 — with GitHub Actions Inactive
@ebardelli
Copy link
Contributor Author

looks like you need to regenerate the lockfile

Done and forced pushed.

version 1.30.0. This uses an older version of duckdb

How old we talking? WASM sometimes lags duckdb

https://www.npmjs.com/package/@duckdb/duckdb-wasm?activeTab=versions

It looks like 1.30.0 was released 2 months ago, 1.31.0 1 month ago, and 1.31.1-dev31.0 yesterday (probably to line up with 1.4.2).

@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 13, 2025 20:54 — with GitHub Actions Inactive
@archiewood
Copy link
Member

seems like some legitimate tests failing in universal-sql to do with parquet writing

https://github.com/evidence-dev/evidence/actions/runs/19345379304/job/55344745970

@ebardelli
Copy link
Contributor Author

I thought I did run format and added a changeset. I might have removed them when I forced pushed yesterday.

@ebardelli
Copy link
Contributor Author

ebardelli commented Nov 13, 2025

Yeah. These fail also on main. I fixed them in #3243.

Would you rather just merge the two pull requests into one?

@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 14, 2025 15:08 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 14, 2025 15:11 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 14, 2025 16:42 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 14, 2025 16:46 — with GitHub Actions Failure
@ebardelli ebardelli had a problem deploying to Approval required to run action on external PR November 14, 2025 18:26 — with GitHub Actions Failure
@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 14, 2025 18:27 — with GitHub Actions Inactive
@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 14, 2025 18:36 — with GitHub Actions Inactive
@ebardelli ebardelli temporarily deployed to Approval required to run action on external PR November 14, 2025 19:30 — with GitHub Actions Inactive
@archiewood archiewood merged commit e970ce1 into evidence-dev:main Nov 14, 2025
10 checks passed
@adam-homeboost
Copy link

thank you for this!

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.

3 participants