Where does the copy command save the Exported file in Wasm #1714
Replies: 2 comments
-
By default everything in WASM is in memory. There are exceptions to that if you are using extensions. When you write to a file like this, it is saved first as a registered (in-memory, virtual) file. Your can write the contents of the file to a file buffer and then use Angular/JavaScript to do what you like with the buffer. See https://shell.duckdb.org/docs/classes/index.AsyncDuckDB.html#registerFileBuffer. There is a popular library for React that has an example of how to do this in React https://github.com/holdenmatt/duckdb-wasm-kit/blob/main/src/files/exportFile.ts. or you can see how they do it in https://shell.duckdb.org at The error you are seeing could be from various issues. What version of duckdb-wasm? What bundle and version of the bundle? How are you implementing DuckDB-WASM in Angular and can you show your code? What is the contents of the parquet file? Have you tried a simple example first like |
Beta Was this translation helpful? Give feedback.
-
As @dude0001 says, issue a |
Beta Was this translation helpful? Give feedback.
-
Hi
I am using DuckDB-WASM in Angular to query a Parquet to convert its format to JSON to bind it to grid.
I am using the below COPY command to export data from a Parquet file as JSON.
await conn?.send(
COPY (SELECT * FROM sample.parquet) TO 'output.json'
)when i run this command, I am getting the error "Buffering Missing file: output.json".
I am not able to identify in which memory or directory is this file saved? Can anyone provide details on in which memory or directoy does wasm usually export the files.
Beta Was this translation helpful? Give feedback.
All reactions