Closed rohitgarud closed 7 months ago
Thanks for the request! I would also love this, but it needs dynamic extension loading.
As soon as the DuckDB team pushes 0.9.0 support to npm (stilll wip), I’ll update and look into adding json.
Thanks for the request! I would also love this, but it needs dynamic extension loading.
As soon as the DuckDB team pushes 0.9.0 support to npm (stilll wip), I’ll update and look into adding json.
Thank you for the quick response.. looking forward to the update..
How can we save the result of the query (Arrow) to a JSON file? JSON.stringify after arrowToJSON is throwing BigInt not JSON serializable error.. Please let me know if there is any solution
If your datasets are large, it's better to avoid converting to JSON, and access the values via the row proxy objects, like this:
const row = arrow.get(rowIndex);
If you do want to convert a whole Arrow table to JSON, you can do:
const jsonRows = arrow.toArray().map((row) => row.toJSON());
DuckDB outputs BigInts by default. To convert them to JS numbers, you'll want to use the castBigIntToDouble
config value
as documented here.
Thank you very much for the detailed response.. very helpful..
I've upgraded to the latest duckdb-wasm version, which now supports dynamic extension loading.
I haven't played with the "json" extension myself, but it should now be usable when you execute load "json"
as described here: https://duckdb.org/docs/extensions/json.html
Let me know if you have any issues with it :)
This is a feature request rather than an issue!!
Thank you for this amazing package. I was wondering whether it is possible to add support to directly import JSON files as DuckDB itself supports this.