Duckdb: Node.js bindings

Created on 8 Jun 2020  路  9Comments  路  Source: cwida/duckdb

Has any work gone in to writing Node.js bindings for DuckDB?

API enhancement

Most helpful comment

I am working on this now, around the sqlite3 API. Latest stuff in nodejs branch. Instructions above still valid.

All 9 comments

None that I know of

Would love to see this added if feasible

I made a very basic proof-of-concept version of DuckDB for node.js. It currently lives in the nodejs branch. Install like so:

````bash
git checkout nodejs
cd tools/nodejs
./configure
npm install .

to run some very basic test:

node test.js
````

The API is something that we still need to figure out. @willium @ali-habibzadeh , I am open to suggestions.

That's exciting, especially if at some point there is a WASM version of DuckDB (https://github.com/cwida/duckdb/issues/310). My only comment about the API is that it may be worth checking out the existing sqlite wrappers (e.g. https://www.npmjs.com/package/sqlite3) and see whether you want to copy their naming (e.g. using a class instead of a function to create a db).

I think it'd also be awesome to have some kind of query builder like https://github.com/sqorn/sqorn or https://github.com/ggmod/type-sql similar to your Python API (https://github.com/cwida/duckdb/blob/master/examples/python/duckdb-python.py#L40).

We're happy to just duplicate the sqlite3 API if people are happy with that one. With the WASM, I am a bit suspicious about performance there. Adding the query builder like in the Python API is something that we are only too happy to add here as well.

Actually... if we expose API similar to sqlite then probably various (parts of) sqlite bindings for node can be reused too?

Yes exactly our battle plan for this is to take the node.js sqlite bindings, and rip out sqlite and replace with DuckDB.

I am working on this now, around the sqlite3 API. Latest stuff in nodejs branch. Instructions above still valid.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waynelapierre picture waynelapierre  路  9Comments

dustalov picture dustalov  路  4Comments

pdet picture pdet  路  5Comments

hannesmuehleisen picture hannesmuehleisen  路  6Comments

Mytherin picture Mytherin  路  8Comments