extensions.sql
Optional capabilities for the runtime
Extensions — optional capabilities for the runtime
Phase: Pre-catalog | Order: 3 | Required: No
OndatraSQL runs directly on DuckDB, and inherits its extension system.
Extensions add capabilities like cloud storage, external databases, or geospatial functions — without adding services or dependencies.
Most projects don’t need this. Extensions are loaded only when required.
Use this file when an extension must be available before the pipeline runs. For example:
- Accessing S3 or cloud storage
- Connecting to external databases
- Using geospatial or specialized functions
There are two ways to use extensions:
extensions.sql— load once for the entire runtime (global)@extensiondirective — load only for a specific model (local)
Prefer @extension unless the extension is required early (e.g. in catalog.sql).
Common Extensions
Cloud storage
-- Required for S3 / HTTP access
INSTALL httpfs;
LOAD httpfs;
External databases
-- PostgreSQL connector
INSTALL postgres;
LOAD postgres;
-- MySQL connector
INSTALL mysql;
LOAD mysql;
Specialized functions
-- Geospatial support
INSTALL spatial;
LOAD spatial;
Extensions are part of DuckDB — not a separate plugin system. They are loaded into the runtime and used transparently by your models.
DuckDB automatically loads most core extensions on first use.
You only need to install/load extensions explicitly when:
- They must be available before execution (e.g.
catalog.sql) - You use community extensions
For advanced use cases, see the DuckDB extensions documentation.
Ondatra Labs