Ducklings API Documentation
    Preparing search index...

    Interface InitOptions

    Options for initializing the DuckDB WASM module.

    interface InitOptions {
        config?: DuckDBConfig;
        useMainThread?: boolean;
        wasmJsUrl?: string;
        wasmModule?: Module;
        wasmUrl?: string;
        worker?: Worker;
        workerUrl?: string;
    }
    Index

    Properties

    config?: DuckDBConfig

    DuckDB configuration options. Controls access mode, security settings, and custom configuration.

    useMainThread?: boolean

    Whether to use the main thread instead of a Web Worker. Defaults to false (use Web Worker). Note: Main thread mode blocks the UI during operations.

    wasmJsUrl?: string

    URL to the Emscripten JS file (duckdb.js). Required for proper bundler support.

    wasmModule?: Module

    Pre-compiled WebAssembly.Module (for Cloudflare Workers). In Workers, import the WASM file directly and pass it here.

    wasmUrl?: string

    URL to the WASM file (for browser environments). If not provided, uses the default bundled WASM location.

    worker?: Worker

    Pre-created Worker instance. Use createWorker for CDN loading to work around cross-origin restrictions.

    import { createWorker, getJsDelivrBundle, init } from '@ducklings/browser';

    const bundle = getJsDelivrBundle();
    const worker = await createWorker(bundle.mainWorker);
    await init({ worker, wasmUrl: bundle.wasmModule, wasmJsUrl: bundle.wasmJs });
    workerUrl?: string

    URL to the worker script (for browser environments). If not provided, uses the default bundled worker location.