Works on Darwin ARM64 (Apple Silicon), Linux x64, and Win32 x64.
GitHub Actions workflow builds and tests bindings & API and publishes NPM packages (currently to GitHub Packages registry in this repository).
NPM packages are split: one for the high-level API, one for the low-level bindings, and one for each supported platform to hold platform-specific binaries.
Installation of the correct platform-specific binaries is handled automatically by NPM using optional dependencies and platform & architecture tags. No install scripts are required.
Released DuckDB binaries are used; DuckDB is not rebuilt.
Bindings are hand-written (not generated), but in a very mechanical style that should make detecting and incorporating upstream changes as easy as possible.
Bindings map C parameters and return values into as-close-as-possible concepts in JS. In particular, Napi::External is used to safely and efficiently wrap objects created and returned by the C API.
API wraps the C API and exposes a more natural object-oriented JavaScript API.
API supports converting all DuckDB data types into easy-to-use JS objects, without loss of precision.
API is written in TypeScript and packages including full type definitions.
Both bindings and API have good unit test coverage.
Not all APIs are implemented yet, but running queries (including streaming & prepared) works.
Merge alternate implementation into main.
Highlights of this implementation: