Skip to content

Database Sources

Database sources use dlt’s sql_database connector, which supports any SQLAlchemy-compatible database. Data is synced to parquet and queryable alongside your other sources.

Terminal window
dinobase add <type> --connection-string <url>
dinobase sync

Credentials can also be set via the DATABASE_URL environment variable.

Terminal window
dinobase add postgres --connection-string postgresql://user:pass@host:5432/dbname

Metadata: Column comments and foreign key relationships extracted from pg_catalog.

Terminal window
dinobase add mysql --connection-string mysql://user:pass@host:3306/dbname

MySQL-compatible.

Terminal window
dinobase add mariadb --connection-string mysql://user:pass@host:3306/dbname
Terminal window
dinobase add mssql --connection-string mssql+pyodbc://user:pass@host/dbname

Requires: pip install pyodbc

Terminal window
dinobase add oracle --connection-string oracle://user:pass@host:1521/service

Requires: pip install cx_Oracle

Terminal window
dinobase add sqlite --path /path/to/database.db
Terminal window
dinobase add snowflake --connection-string snowflake://user:pass@account/db/schema

Requires: pip install snowflake-sqlalchemy

Terminal window
dinobase add bigquery --connection-string bigquery://project/dataset

Requires: pip install sqlalchemy-bigquery

Terminal window
dinobase add redshift --connection-string redshift+psycopg2://user:pass@host:5439/db

Requires: pip install sqlalchemy-redshift

Terminal window
dinobase add clickhouse --connection-string clickhouse://user:pass@host:8123/db

Requires: pip install clickhouse-sqlalchemy

PostgreSQL-compatible.

Terminal window
dinobase add cockroachdb --connection-string postgresql://user:pass@host:26257/db
Terminal window
dinobase add databricks --connection-string databricks://token:TOKEN@host:443/db

Requires: pip install databricks-sql-connector

Terminal window
dinobase add trino --connection-string trino://user@host:8080/catalog/schema

Requires: pip install trino

Terminal window
dinobase add presto --connection-string presto://user@host:8080/catalog/schema

Requires: pip install pyhive

Terminal window
dinobase add duckdb_source --connection-string duckdb:///path/to/file.duckdb

Connection strings follow SQLAlchemy format:

dialect+driver://username:password@host:port/database

Examples:

postgresql://admin:secret@db.example.com:5432/myapp
mysql://root:pass@localhost:3306/analytics
snowflake://user:pass@xy12345.us-east-1/MYDB/PUBLIC

Database sources sync all user tables by default. After syncing, tables are accessible as source_name.table_name:

Terminal window
dinobase add postgres --connection-string ... --name production
dinobase sync
dinobase query "SELECT * FROM production.users LIMIT 5" --pretty