InternalCreates a new DuckDB instance.
Optionalworker: WorkerThe Web Worker to use for DuckDB operations Use init() instead of creating directly
Closes the database and releases all resources.
Creates a new connection to this database.
Multiple connections can be created to the same database. Each connection maintains its own transaction state.
Promise resolving to a new Connection instance
Export a file to a buffer.
The virtual file name to export
The file contents
Copy a file to another path.
The source file name
The destination path
Remove a registered file.
The virtual file name to remove
Remove all registered files.
Flush all file buffers.
Get the DuckDB library version.
List files matching a glob pattern.
The glob pattern to match
List of matching files
InternalInstantiate the WASM module in the worker.
OptionalwasmUrl: stringOptionalwasmJsUrl: stringInternalOpen the database.
Optionalconfig: DuckDBConfigOptional configuration options
InternalPost a request to the worker and return a promise for the response.
Optionaldata: unknownOptionaltransfer: Transferable[]Register an in-memory buffer as a virtual file.
The virtual file name to use
The file contents
Register a text string as a virtual file.
The virtual file name to use
The file contents as a string
Register a remote file by URL.
The virtual file name to use
The URL to fetch the file from
Optionalprotocol: stringOptional protocol hint ('HTTP' or 'HTTPS')
OptionaldirectIO: booleanWhether to use direct I/O
StaticcreateCreates a new DuckDB database and initializes the WASM module if needed.
This is a convenience method that combines init() and connect().
Promise that resolves to a new Connection instance
DuckDB database instance.
This is the main entry point for using DuckDB in WASM. Create a database instance, then create connections to execute queries.
Example