We're still on a journey to explore what APIs work best with JavaScript but the differences between WASM and Node are on purpose.
DuckDB-Wasm has isolated wasm heap memory and runs in a separate web worker.
That's why we serialize everything as Arrow IPC buffer and pass the ArrayBuffer through the workers message API as transferrable.
On Node.js, we can interact with DuckDB much more easily and don't want to pay the price for the IPC stream every time.
The truth is, we tried quite a few different APIs and this turned out the be a good trade off between efficiency and convenience.But I'm happy to discuss this further if you have any suggestions.
No comments yet.