Initialize the DuckDB WASM module.
This function must be called before creating any DuckDB instances. It spawns a Web Worker and initializes the WebAssembly module inside it.
URLs for worker, WASM, and JS files are automatically resolved from the library location. You can override them if needed.
Optional
Optional initialization options
Promise that resolves when initialization is complete
import { init, DuckDB } from '@ducklings/browser';await init();const db = new DuckDB();const conn = await db.connect();const rows = await conn.query('SELECT 42 as answer');console.log(rows);await conn.close();await db.close(); Copy
import { init, DuckDB } from '@ducklings/browser';await init();const db = new DuckDB();const conn = await db.connect();const rows = await conn.query('SELECT 42 as answer');console.log(rows);await conn.close();await db.close();
Initialize the DuckDB WASM module.
This function must be called before creating any DuckDB instances. It spawns a Web Worker and initializes the WebAssembly module inside it.
URLs for worker, WASM, and JS files are automatically resolved from the library location. You can override them if needed.