You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Querying with a bigint value from the nodejs binding fails to match a bigint value in the database.
To Reproduce
Reproducer code:
import{Callback,Database,DuckDbError,TableData}from"duckdb";import{QueryResult}from"./storage/storage";import{Conversation}from"./model/conversation";constdatabase=newDatabase("./test.db");constconnection=database.connect();constall=(sql: string, ...args: any[]): Promise<QueryResult>=>{returnnewPromise((resolve,reject)=>{constcallback: Callback<TableData>=(err: DuckDbError|null,res: TableData): void=>{if(err)returnreject(err);returnresolve(res);}returnconnection.all(sql, ...args,callback);});}(async()=>{constexitHandler=async()=>{process.exit(0);}process.on('SIGINT',exitHandler);process.on('SIGTERM',exitHandler);console.log("- Create test data:");constres=awaitall(` CREATE SEQUENCE test_seq; CREATE TABLE test ( id BIGINT PRIMARY KEY DEFAULT nextval('test_seq'), value TEXT ); INSERT INTO test (value) VALUES ('test') RETURNING id;`);console.log(res[0]["id"]," => ",typeofres[0]["id"]);console.log("- Query with number:");constres2=awaitall(` SELECT id, value FROM test WHERE id = ?::BIGINT`,1// <-- number);console.log(res2[0]["id"]," => ",typeofres2[0]["id"]);console.log("- Query with bigint:");constres3=awaitall(` SELECT id, value FROM test WHERE id = ?::BIGINT`,1n// <-- bigint);console.log(res3[0]["id"]," => ",typeofres3[0]["id"]);})();process.stdin.resume();
Result:
$ node build/test.js
- Create test data:
1n => bigint
- Query with number:
1n => bigint
- Query with bigint:
/Users/noctarius/WebstormProjects/untitled/build/test.js:40
console.log(res3[0]["id"], " => ", typeof res3[0]["id"]);
^
TypeError: Cannot read properties of undefined (reading 'id')
at /Users/noctarius/WebstormProjects/untitled/build/test.js:40:24
Node.js v22.0.0
OS:
MacOS 14.4.1
DuckDB Version:
v0.10.2
DuckDB Client:
NodeJS
Full Name:
Chris Engelbert
Affiliation:
simplyblock
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Yes, I have
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
Yes, I have
The text was updated successfully, but these errors were encountered:
What happens?
Querying with a bigint value from the nodejs binding fails to match a bigint value in the database.
To Reproduce
Reproducer code:
Result:
OS:
MacOS 14.4.1
DuckDB Version:
v0.10.2
DuckDB Client:
NodeJS
Full Name:
Chris Engelbert
Affiliation:
simplyblock
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
The text was updated successfully, but these errors were encountered: