motherduck database entry can be added by specifying type: motherduck in your
~/.config/oxy/config.yml file.
This integration allows Oxy to query databases hosted in MotherDuck, the cloud-based DuckDB platform, using your authentication token.
Required fields
Eachmotherduck entry requires the following fields:
token_var– The name of the environment variable that stores your MotherDuck authentication token.type– Must be set tomotherduck.
Optional fields
database– The name of the specific MotherDuck database to connect to. If omitted, connects to your default database.schemas– A map of schema names to table patterns for filtering which schemas/tables to sync. Each key is a schema name, and the value is an array of table patterns (use["*"]for all tables in that schema). If omitted, all schemas will be synced.
Authentication
Oxy connects to MotherDuck using an authentication token. You should store this token as an environment variable and reference it viatoken_var.
For example, if your variable is MOTHERDUCK_TOKEN, make sure it’s exported in your environment before running any queries:
.env file:
Sample config entries
Connect to default database
Connect to specific database
Filter by specific schemas
Usage notes
- MotherDuck uses the DuckDB SQL dialect, so all DuckDB features and functions are available.
- Queries are executed in the cloud and results are streamed back to Oxy.
- You can query both cloud-based tables and local files using DuckDB’s hybrid execution model.
- MotherDuck provides automatic caching and optimization for better query performance.
- Schema sync: Use
oxy syncto automatically generate semantic models from your MotherDuck database schema.
Syncing your schema
You can automatically generate semantic models from your MotherDuck database schema using theoxy sync command:
- Query your MotherDuck database’s
information_schemato discover all tables and columns - Generate semantic model YAML files in your project’s configured location
- Include table names, column names, and data types
schemas field in your config:
Troubleshooting
- Token issues: Ensure your
MOTHERDUCK_TOKENenvironment variable is set correctly and contains a valid token. - Database not found: Verify the database name in your config matches an existing database in your MotherDuck account.
- Connection errors: Check your internet connectivity and verify you can access MotherDuck through their web console.
- Sync issues: If
oxy syncfails, ensure your token has read permissions on the database schema.