-
Can I use DuckDBClient in the data loader? If so, is there an example? I found that the existing example (observablehq/framework/examples/loader-duckdb) is shell-based. But I want to use js + DuckDBClient. Is this okay? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Framework’s That said, it’s probably better to use the official Node.js API for DuckDB in a Node.js data loader rather than using Framework’s |
Beta Was this translation helpful? Give feedback.
Framework’s
DuckDBClient
client is currently built-in to Framework (it’sobservablehq:stdlib/duck
), so you can’t import it into a Node.js program. There’s an open issue #852 to publish a few of these built-in libraries to npm. You might be able to copy the source code and with a few changes get it working in Node.js.That said, it’s probably better to use the official Node.js API for DuckDB in a Node.js data loader rather than using Framework’s
DuckDBClient
. Theduckdb-async
package provides a Promise-based API (and TypeScript types, if you want to use a TypeScript data loader).