Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/prebuild-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-<platform> 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: |
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 27 additions & 0 deletions test/pack/installed.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
20 changes: 11 additions & 9 deletions update_libchdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ set -e
LATEST_RELEASE=v26.5.1-rc.1

# Version published for the @chdb/lib-<platform> 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
Expand Down
Loading