Get the logger
Get the logger
Cancel a pending query.
On the threads bundle the worker runs a poll to its end before it reads another message, so the query is interrupted through shared memory first (getInterruptHandle): a running poll stops at the engine's next check and fails with an interrupt error, and in-flight HTTP requests of the query are abandoned. The cancel message then ends the query in the worker, if the poll has not already ended it.
Close a prepared statement
Enable file statistics
Connect to the database
Connect to the database
Copy a file to a buffer.
Copy a file to a path.
Prepare a statement and return its identifier
Detach from worker
Disconnect from the database
Try to drop a file
Try to drop files
Optionalnames: string[]Fetch query results
Flush all files
Get the feature flags
The connection's interrupt flag, or null when the wasm memory is not shared (the base bundle). Then
interruptConnection(handle) interrupts what runs on the connection from any thread, also while the worker is
inside the call that runs it and no message reaches it.
The connection's query progress slot, or null when the wasm memory is not shared (the base bundle). Read it
with readQueryProgress(handle), also while a query runs. The engine reports progress only with
SET enable_progress_bar = true.
The progress of the connection's query as the engine last reported it, on every bundle. The worker answers between two calls only: on the threads bundle, read a running query's progress with getProgressHandle.
Get table names
Get the version
Insert arrow from an ipc stream
Optionaloptions: ArrowInsertOptionsInsert a json file
Open the database
Optionalprogress: (progress: InstantiationProgress) => voidIs in detached state, no worker defined
Ping the worker thread
Poll a pending query
Haybarn: download, hash and compile extensions ahead of LOAD.
In browsers, LOAD downloads each extension synchronously and hashes it with SHA-256 compiled to wasm before
checking its signature, then compiles it. This does that work in the worker ahead of time: the downloads run in
parallel, the hash is computed with WebCrypto and the module is compiled with WebAssembly.compileStreaming. A
later LOAD <name> that resolves to the same URL then only checks the signature, against that hash, and
dlopen uses the compiled module once the check has passed. Settings that change the URL (such as
custom_extension_repository, or INSTALL <name> FROM <repository> / VERSION) must come first.
Call it while setting up the session, before running queries. Requests sent while a prefetch runs wait for it.
Resolves to the names that are held for LOAD, once every download has finished, failed or timed out (after
timeoutMs, 30 seconds by default). A name that can't be resolved or downloaded is skipped, leaving the
download to LOAD, which reports any error; so are extensions that are already loaded. Each prefetched extension
serves one LOAD, at most 256 MiB is held for LOADs that haven't run yet, and reset() or open() drops what no
LOAD took. Does nothing in Node.js.
OptionaltimeoutMs: numberRegister a SharedArrayBuffer of at least 4 bytes through which any thread can cancel the most recently started
pending query: Atomics.store(new Int32Array(sab), 0, 1). The flag is checked before each poll and every
50 ms while a pending query runs; a cancel resets it to 0 and goes through cancelPendingQuery, so on the
threads bundle it also interrupts a poll that is running. For a specific connection use cancelSent() or
getInterruptHandle. Registering again replaces the buffer.
Register an empty file buffer.
Register a file buffer.
Register a file handle.
Register file text
Register a file path.
Prepare an opfs:// file (or the files a glob pattern matches) for the next queries, returns their names.
Registered files are held open until they are dropped, for writing unless mode is 'read'
Reset the duckdb
Execute a prepared statement and return the full result
Run a query
Execute a prepared statement and stream the result
Kill the worker
An interface for the async DuckDB bindings