Repository navigation
flatten SQL fragments in DuckDBClient.sql - #197
Conversation
mbostock
left a comment
There was a problem hiding this comment.
Seems right functionally. But I wonder how the bundling works because sql.js is normally bundled with the runtime and duckdb.js is imported dynamically… I think this means that sql.js has to be bundled separately from the rest of the runtime, which might make loading the standard library slightly slower…
One alternative would be that we have to pass in the sql implementation when loading DuckDBClient (and by that I mean internally, when Notebook Kit calls import("./duckdb.js"); this would not be an obligation of the user)… but that’s tricky.
Another alternative would be to do a dynamic import of ./sql.js in src/runtime/stdlib/index.ts… Then you only pay the latency cost when you are using DatabaseClient or DuckDBClient which is likely the way to go.
|
Aren't we already loading and running |
|
So I guess I just revert 81f11c4 ? |
Reverts 81f11c4
DuckDBClient.sqlnow flattens SQL fragments before it runs the query. Fragments, views (sql.view), and variants (sql.variant,sql.ident) now work with DuckDB.