ReviewOS

home-lang/home

Port DuckDB Node API compatibility contracts

#209
Closed chris opened this 10 days ago ·
10 days ago

Context

The sequential Bun corpus frontier is now js/third_party/@duckdb/node-api/duckdb.test.ts at position 3949/4708, following completed Azure module support in #208. This contributes to #66.

Current gap

The module prepares, but runtime resolution fails with Cannot find module '@duckdb/node-api'. The copied suite contains 18 broad API tests, not just an import smoke test.

Scope

  • Numeric enums (ResultReturnType, StatementType) with reverse mappings.
  • DuckDB type/value/vector classes and string/conversion behavior across scalar and nested data types.
  • Instance/connection lifecycle, basic queries, prepared and pending statements, incremental execution, and streaming.
  • Data chunks, result metadata/inspection conveniences, readers, and configurable duckdb_api loading.
  • Correct cleanup and deterministic errors without native-addon stack leakage.

Acceptance criteria

  • require('@duckdb/node-api') resolves through Home's module system.
  • All 18 copied DuckDB Node API tests pass logically, including the all-data-types matrix.
  • Async instance/connection/statement/result lifecycle matches the tested API.
  • Vector validity, item access, value conversions, and nested type metadata match expectations.
  • The exact passing result is pinned in the permanent third-party gate.
10 days ago

Completed on main in 7e91f84ea3a6693ad016a2a654ab09f92f596c1e (feat(third-party): port DuckDB Node API).

js/third_party/@duckdb/node-api/duckdb.test.ts is fully green at 18 passed, 0 failed, 0 TODO, 0 unsupported.

Implemented and verified:

  • Reversible result/statement/type/pending enums and DuckDB type metadata/string forms.
  • Scalar, temporal, decimal, blob, interval, UUID, bit, and nested list/array/map/struct/union value behavior.
  • Typed vectors, data chunks, result metadata, chunk/row/column readers, and 2,048-row streaming.
  • Async instance/connection/prepared/pending/result-reader lifecycle and configuration overrides.
  • The complete 54-column test_all_types min/max/null matrix, including 70,000-entry enum metadata.
  • Exact 18-test result pinned in the permanent third-party gate, which passes in full.

The sequential frontier advances through 3949/4708. PGlite is tracked next in #210.

Sign in to comment on this issue.