Closed Mickael-van-der-Beek closed 2 months ago
Seeing the same issue, also on Apple Silicone
Confirm the same issue, reproduces on macos (arm) and linux, Node.js v20.10.0, libchdb installed
/Users/sergees/repos/deno_chdb/node_modules/chdb/index.js:12
return chdbNode.Query(query, format);
It works now on my macOS M1:
~/Codes/go/src/github.com/auxten/node-play ll
total 24
-rw-r--r-- 1 auxten staff 751B Jun 12 11:13 e1.js
drwxr-xr-x 7 auxten staff 224B Jun 12 11:11 node_modules
-rw-r--r-- 1 auxten staff 2.1K Jun 12 11:11 package-lock.json
-rw-r--r-- 1 auxten staff 49B Jun 12 11:11 package.json
~/Codes/go/src/github.com/auxten/node-play node e1.js
Standalone Query Result: "23.10.1.1","Hello chDB","1.1.0"
Session Query Result: 123
Session Query Result: 1
2
3
~/Codes/go/src/github.com/auxten/node-play cat e1.js
const { query, Session } = require("chdb");
var ret;
// Test standalone query
ret = query("SELECT version(), 'Hello chDB', chdb()", "CSV");
console.log("Standalone Query Result:", ret);
// Test session query
// Create a new session instance
const session = new Session("./chdb-node-tmp");
ret = session.query("SELECT 123", "CSV")
console.log("Session Query Result:", ret);
ret = session.query("CREATE DATABASE IF NOT EXISTS testdb;" +
"CREATE TABLE IF NOT EXISTS testdb.testtable (id UInt32) ENGINE = MergeTree() ORDER BY id;");
session.query("USE testdb; INSERT INTO testtable VALUES (1), (2), (3);")
ret = session.query("SELECT * FROM testtable;")
console.log("Session Query Result:", ret);
// Clean up the session
session.cleanup();
Please try again, I think it should be fixed on v1.2.0
This is quite a simple issue, none of the examples in the README file work:
Example n°1:
Will produce the following error:
Uncaught Error: Error in native callback
.Example n°2:
Will make
ret
have the value''
(empty string).Here's my environment:
OS: Mac OSX Ventura 13.2.1 Architecture: M1 Apple Silicone Package Version: 1.1.2 Node.js Version: v18.4.0