Ducklings API Documentation
    Preparing search index...
    • 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.

      Parameters

      • Optionaloptions: string | InitOptions

        Optional initialization options

      Returns Promise<void>

      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();