chdb-node icon indicating copy to clipboard operation
chdb-node copied to clipboard

Question: Similar to DuckDB Node JS API

Open ceckoslab opened this issue 1 year ago • 2 comments

Hello @auxten

I am talking with a few enthusiasts and we are considering to add a few things that will improve the developers' experience on CHDB.

We could work on a proof of concept but first we would like to know if you would be interested to have similar to DuckDB Node JS API - ref: https://duckdb.org/docs/api/nodejs/overview

Something like this that would make it easier when building queries:

db.all('SELECT ?::INTEGER AS fortytwo, ?::VARCHAR AS hello', 42, 'Hello, World', function(err, res) {
  if (err) {
    console.warn(err);
    return;
  }
  console.log(res[0].fortytwo)
  console.log(res[0].hello)
});

ceckoslab avatar Nov 18 '24 20:11 ceckoslab

Nice, you are right. This style is more Node JS style. I will try to sort it out how to do that. But frankly speaking, I'm not a JS expert. If you would like to help on this and I could do the C/C++ part ;)

auxten avatar Nov 19 '24 04:11 auxten

Among the enthusiasts we have someone who knows C/C++, Node JS and TypeScript. We are thinking to work on a very minor proof of concept and to share it as a draft pull request.

It will take a while but we will keep you posted.

ceckoslab avatar Nov 19 '24 09:11 ceckoslab

@auxten could you take a look at thus MR https://github.com/chdb-io/chdb-node/pull/24 and let us know if we need to do any changes?

ceckoslab avatar May 31 '25 13:05 ceckoslab

Solution provided by @rajdude0

ceckoslab avatar Jun 05 '25 07:06 ceckoslab