diff --git a/.github/workflows/chdb-node-test.yml b/.github/workflows/chdb-node-test.yml index f92b157..c2790bc 100644 --- a/.github/workflows/chdb-node-test.yml +++ b/.github/workflows/chdb-node-test.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - node-version: [16.x, 18.x] + node-version: [18.x, 20.x, 22.x] steps: - name: Use Python 3.11 uses: actions/setup-python@v2 @@ -34,7 +34,7 @@ jobs: - name: Run tests run: npm run test - name: Publish to npm - if: github.ref == 'refs/heads/main' && matrix.node-version == '16.x' && matrix.os == 'ubuntu-latest' + if: github.ref == 'refs/heads/main' && matrix.node-version == '18.x' && matrix.os == 'ubuntu-latest' run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 08bb766..ea88210 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build .vscode/ libchdb.so chdb.h +chdb.hpp diff --git a/package-lock.json b/package-lock.json index 8622a25..6f55b15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chdb", - "version": "1.1.4", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chdb", - "version": "1.1.4", + "version": "1.4.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -17,6 +17,9 @@ "chai": "^4.5.0", "mocha": "^10.7.3", "node-gyp": "^9.3.1" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@gar/promisify": { @@ -205,10 +208,11 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -262,10 +266,11 @@ } }, "node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -843,11 +848,15 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "dev": true + "node_modules/ip-address": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -1171,10 +1180,11 @@ } }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1576,16 +1586,17 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", "dev": true, + "license": "MIT", "dependencies": { - "ip": "^2.0.0", + "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, @@ -1678,10 +1689,11 @@ } }, "node_modules/tar": { - "version": "6.1.14", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.14.tgz", - "integrity": "sha512-piERznXu0U7/pW7cdSn7hjqySIVTYT6F76icmFk7ptU7dDYlXTm5r9A6K04R2vU3olYgoKeo1Cg3eeu5nhftAw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", diff --git a/package.json b/package.json index 4c466e3..92d5084 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chdb", - "version": "1.3.0", + "version": "1.4.0", "description": "chDB bindings for nodejs", "main": "index.js", "repository": { @@ -19,6 +19,9 @@ "email": "auxten@clickhouse.com" }, "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + }, "devDependencies": { "chai": "^4.5.0", "mocha": "^10.7.3", diff --git a/test.js b/test.js index 5968af3..e5af13e 100644 --- a/test.js +++ b/test.js @@ -78,7 +78,7 @@ describe('chDB Queries', function () { session.query("USE testdb; INSERT INTO testtable VALUES (1), (2), (3);"); - const ret = session.query("SELECT * FROM testtable;", "CSV"); + const ret = session.query("SELECT * FROM testdb.testtable;", "CSV"); console.log("Session Query Result:", ret); expect(ret).to.be.a('string'); expect(ret).to.include('1'); @@ -93,7 +93,7 @@ describe('chDB Queries', function () { }); it('should return result of the query made using bind parameters', () => { - const ret = session.queryBind("SELECT * from testtable where id > {id: UInt32}", { id: 2}, "CSV"); + const ret = session.queryBind("SELECT * from testdb.testtable where id > {id: UInt32}", { id: 2}, "CSV"); console.log("Bind Session result:", ret); expect(ret).to.not.include('1'); expect(ret).to.not.include('2'); diff --git a/update_libchdb.sh b/update_libchdb.sh index 404fac0..c3701c3 100755 --- a/update_libchdb.sh +++ b/update_libchdb.sh @@ -10,7 +10,7 @@ cd "$(dirname "$0")" # Get the newest release version # LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/chdb-io/chdb/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') -LATEST_RELEASE=v2.1.1 +LATEST_RELEASE=v3.6.0 # Download the correct version based on the platform case "$(uname -s)" in