-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No examples work #9
Comments
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
|
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: