Hi. I tried to use an SQL Pivot-statement (PIVOT ... ON ... USING) within an SQL Cell in a Notebook. I get Error: Parser Error: syntax error at or near "PIVOT", and it looks like perhaps that Statement is not supported by the DuckDB-Wasm that is included in Notebooks?
I checked the stdlib, which says that DuckDB-Wasm v 1.24 is included in Observable. I then checked with the DuckDB-Wasm documentation and the Browser demo-Prompt, which runs on v1.2.0 does in fact support PIVOT (I just hacked in the PIVOT-example from here and it works).
Whatās a bit strange is that when I run SELECT version() AS version; inside an SQL cell in a notebook, I get v0.0.1-dev0, whereas in the demo-Prompt I get v1.2.0, so perhaps indeed the Notebook-DuckDB-Wasm-Version is somewhat outdated?
Weāre unfortunately still in the process of resolving an issue where range requests are incorrectly served from compressed files, which causes errors in Safari when file attachments are used with a newer version of DuckDB.
OK, so then it is indeed 1.24, so I donāt get why the PIVOT command then doesnāt work⦠I tried this in Chrome, so I donāt see a link to the Safari error that you quote. Thanks.
Thanks for checking! I think the problem in Safari only shows itself with file attachments that get compressed at rest (which isnāt the case for every MIME type and requires a certain effective reduction in size).
Just a quick update here: I noticed that with your latest DuckCBClient, when I try to run: db = DuckDBClient.of({query_data: FileAttachment(āmy_file.tsvā)}) I get en error db = Error: invalid source: [object Object]. The same code works with the native (and old-version) DuckDBClient.
And this happens on both Chrome and Safari, so not sure whether itās related to the issue you mentioned. I can try to make a minimal example, but Iām traveling the next days, so might take me a bit.
@stschiff There was an instanceof check against FileAttachment that Iāve now replaced with a test of the constructor name. Can you give it another try?
Aaaah, thank you. OK. Sorry, this was the first time I came across the import-locking feature. Very cool. And thanks for the continuous help! It works now.