diff --git a/.github/workflows/prebuild-publish.yml b/.github/workflows/prebuild-publish.yml index 91cba61..69aff10 100644 --- a/.github/workflows/prebuild-publish.yml +++ b/.github/workflows/prebuild-publish.yml @@ -48,6 +48,14 @@ jobs: - run: npm install --ignore-scripts - run: npm run libchdb - run: npm run build + - name: Exercise the freshly built addon (not the published prebuilt) + # The loader prefers the installed @chdb/lib- subpackage over + # a local build (see dist/loader.js). npm install pulls the PREVIOUS + # published subpackage via optionalDependencies, whose addon lags the + # in-repo native source — so without this, test:all exercises the old + # binary instead of the one this run is about to package and publish. + shell: bash + run: rm -rf node_modules/@chdb/lib-* - run: npm run test:all - name: Derive subpackage version from update_libchdb.sh run: | diff --git a/package.json b/package.json index 9ecfdca..56b2ed7 100644 --- a/package.json +++ b/package.json @@ -93,10 +93,10 @@ "node-gyp-build": "^4.6.0" }, "optionalDependencies": { - "@chdb/lib-darwin-arm64": "26.5.2", - "@chdb/lib-darwin-x64": "26.5.2", - "@chdb/lib-linux-arm64-gnu": "26.5.2", - "@chdb/lib-linux-x64-gnu": "26.5.2" + "@chdb/lib-darwin-arm64": "26.5.3", + "@chdb/lib-darwin-x64": "26.5.3", + "@chdb/lib-linux-arm64-gnu": "26.5.3", + "@chdb/lib-linux-x64-gnu": "26.5.3" }, "peerDependencies": { "@clickhouse/client": ">=1.23.0", diff --git a/test/pack/installed.test.mjs b/test/pack/installed.test.mjs index 39925a4..3c1afdc 100644 --- a/test/pack/installed.test.mjs +++ b/test/pack/installed.test.mjs @@ -13,6 +13,9 @@ import { describe, it, expect } from 'vitest' import { query, queryAsync, Session, version } from 'chdb' +// The Layer 3 fluent surface (registerArrowTable / selectFrom / chTable) is +// reached through the default export in ESM — see the index.mjs comment. +import chdb from 'chdb' // Run cases sequentially. The suite mixes the standalone default connection // (`version()`, `query()`, `queryAsync()`) with a `Session` that binds its @@ -37,6 +40,30 @@ describe.sequential('installed chdb package', () => { expect(r.text().trim().split('\n')).toHaveLength(3) }) + it('round-trips Arrow C Data Interface input (native ArrowRegisterColumns)', async () => { + // Guards the addon's export surface, not just its loadability: the + // installed binary comes from the @chdb/lib-* subpackage, which is + // versioned independently of this package — a stale subpackage loads + // and queries fine but lacks the Arrow registration natives. + const t = chdb.registerArrowTable('installed_arrow', [ + { name: 'id', type: 'Int32', data: new Int32Array([1, 2, 3]) }, + { name: 'tag', type: 'String', data: ['a', 'b', 'c'] }, + ]) + try { + const rows = await chdb.selectFrom(chdb.chTable.arrowstream('installed_arrow').as('t')) + .select(['id', 'tag']) + .orderBy('id') + .execute() + expect(rows).toEqual([ + { id: 1, tag: 'a' }, + { id: 2, tag: 'b' }, + { id: 3, tag: 'c' }, + ]) + } finally { + t.close() + } + }) + it('creates a Session and round-trips an insert + query + stream', async () => { const s = new Session() try { diff --git a/update_libchdb.sh b/update_libchdb.sh index c7d6f0e..0c98c6b 100755 --- a/update_libchdb.sh +++ b/update_libchdb.sh @@ -16,15 +16,17 @@ set -e LATEST_RELEASE=v26.5.1-rc.1 # Version published for the @chdb/lib- native subpackages on npm. -# DECOUPLED from LATEST_RELEASE on purpose: chdb-core has no 26.5.2 release, but -# the previously published subpackage versions (26.5.0, 26.5.1-rc.1) shipped a -# non-relocatable Linux binary (chdb-io/chdb-node#50). npm forbids republishing -# over an existing version, so the relocatability fix needs a NEW version — a -# formal packaging revision — while the bundled libchdb stays LATEST_RELEASE -# above (the only build carrying the #73/#15 C-ABI the binding requires). The -# publish + cleanroom workflows read CHDB_LIB_VERSION from here, and the main -# package's optionalDependencies pin this exact value. -LIBCHDB_NPM_VERSION=26.5.2 +# DECOUPLED from LATEST_RELEASE on purpose: chdb-core has no 26.5.x releases +# past 26.5.1-rc.1, but the subpackage also ships the N-API addon, so any +# change to the addon's export surface needs a NEW subpackage version — npm +# forbids republishing over an existing one. 26.5.2 was the relocatability +# packaging revision (chdb-io/chdb-node#50); 26.5.3 adds the Arrow C Data +# Interface exports (ArrowRegisterColumns/…) the Layer 3 arrow-input path +# requires. The bundled libchdb stays LATEST_RELEASE above (the only build +# carrying the #73/#15 C-ABI the binding requires). The publish + cleanroom +# workflows read CHDB_LIB_VERSION from here, and the main package's +# optionalDependencies pin this exact value. +LIBCHDB_NPM_VERSION=26.5.3 # Download the correct version based on the platform case "$(uname -s)" in