Skip to content
Browse documentation
Execution engines

DuckDB

Run SQL analysis against inline data, files, and attached databases.

Configure

typescript
const ava = new AVA({
  llm: { model: 'YOUR_MODEL', apiKey: process.env.OPENAI_API_KEY },
  engine: {
    type: 'duckdb',
    memoryLimit: '512MB',
    threads: 1,
    queryTimeoutMs: 30000,
    maxTempDirectorySize: '1GB',
  },
});

DuckDB is the default Node.js engine. It creates an in-memory instance and registers the source as tables or views. SQL generation uses the schema and optional profile.

Engine options

Set engine.type to duckdb. These are all additional fields accepted on engine.

FieldTypeRequiredMeaning / default
memoryLimitstringNoMemory limit, e.g. '512MB'. Default '512MB'.
threadsnumberNoNumber of worker threads. Default 1.
maxTempDirectorySizestringNoMax size of the spill (temp) directory, e.g. '1GB'. Unset = unlimited.
queryTimeoutMsnumberNoPer-query timeout in milliseconds. Default 30000.
allowCommunityExtensionsbooleanNoAllow DuckDB community extensions during source loading when explicitly needed.

Resource limits

Defaults are 512 MB of memory, one worker thread, and a 30-second query timeout. maxTempDirectorySize is optional; no spill-size limit is configured when omitted.

These options are separate from maxRows and maxResultBytes, which bound returned query results.

Source support

DuckDB supports inline CSV, JSON, and text; local or remote CSV, JSON, Parquet, and Excel; and MySQL, PostgreSQL, SQLite, and MongoDB sources. See data sources for configuration.

Query access

After source registration, the engine restricts external access and locks configuration. Its query dialect validates read-only statements. Community extensions are disabled by default, with handling for sources such as MongoDB that require them; allowCommunityExtensions explicitly enables them when needed.