MotherDuck
This is a step by step guide to integrate MotherDuck / DuckDB and Querio.
1) Create a MotherDuck service token
What: A secure token that allows Querio to connect to your MotherDuck database with read-only access.
How:
- Log in to your MotherDuck account
- Navigate to Settings > Service Tokens
- Click Create Service Token
- Give it a descriptive name (e.g., "Querio Integration")
- Copy the token securely — it will only be shown once
Tip: Store the token securely in a password manager. You won't be able to see it again after creation.
2) Grant read-only access
What: Configure permissions to limit Querio's access to only the data it needs.
How (execute the following SQL in MotherDuck):
-- Grant read access to specific database
GRANT SELECT ON ALL TABLES IN DATABASE my_database TO querio_service_token;
-- For specific schemas
GRANT SELECT ON ALL TABLES IN SCHEMA my_database.my_schema TO querio_service_token;Adjust the database and schema names according to your MotherDuck setup. For DuckDB local files, ensure the service has read permissions to the database file.
3) Collect and share the connection details
What: The connection information Querio needs to connect via SQLAlchemy.
For MotherDuck (Cloud):
Required values:
- Service Token: The token you created in step 1
- Database: The name of your MotherDuck database (e.g.,
my_database)
Connection string format:
md:<database>?motherduck_token=<service_token>Querio uses the SQLAlchemy DuckDB driver to connect. Ensure your token has appropriate permissions for the databases you want to query.