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.
General usage
Section titled “General usage”dinobase add <type> --connection-string <url>dinobase syncCredentials can also be set via the DATABASE_URL environment variable.
Supported databases
Section titled “Supported databases”PostgreSQL
Section titled “PostgreSQL”dinobase add postgres --connection-string postgresql://user:pass@host:5432/dbnameMetadata: Column comments and foreign key relationships extracted from pg_catalog.
dinobase add mysql --connection-string mysql://user:pass@host:3306/dbnameMariaDB
Section titled “MariaDB”MySQL-compatible.
dinobase add mariadb --connection-string mysql://user:pass@host:3306/dbnameMicrosoft SQL Server
Section titled “Microsoft SQL Server”dinobase add mssql --connection-string mssql+pyodbc://user:pass@host/dbnameRequires: pip install pyodbc
Oracle
Section titled “Oracle”dinobase add oracle --connection-string oracle://user:pass@host:1521/serviceRequires: pip install cx_Oracle
SQLite
Section titled “SQLite”dinobase add sqlite --path /path/to/database.dbSnowflake
Section titled “Snowflake”dinobase add snowflake --connection-string snowflake://user:pass@account/db/schemaRequires: pip install snowflake-sqlalchemy
Google BigQuery
Section titled “Google BigQuery”dinobase add bigquery --connection-string bigquery://project/datasetRequires: pip install sqlalchemy-bigquery
Amazon Redshift
Section titled “Amazon Redshift”dinobase add redshift --connection-string redshift+psycopg2://user:pass@host:5439/dbRequires: pip install sqlalchemy-redshift
ClickHouse
Section titled “ClickHouse”dinobase add clickhouse --connection-string clickhouse://user:pass@host:8123/dbRequires: pip install clickhouse-sqlalchemy
CockroachDB
Section titled “CockroachDB”PostgreSQL-compatible.
dinobase add cockroachdb --connection-string postgresql://user:pass@host:26257/dbDatabricks
Section titled “Databricks”dinobase add databricks --connection-string databricks://token:TOKEN@host:443/dbRequires: pip install databricks-sql-connector
dinobase add trino --connection-string trino://user@host:8080/catalog/schemaRequires: pip install trino
PrestoDB
Section titled “PrestoDB”dinobase add presto --connection-string presto://user@host:8080/catalog/schemaRequires: pip install pyhive
DuckDB (external file)
Section titled “DuckDB (external file)”dinobase add duckdb_source --connection-string duckdb:///path/to/file.duckdbConnection string format
Section titled “Connection string format”Connection strings follow SQLAlchemy format:
dialect+driver://username:password@host:port/databaseExamples:
postgresql://admin:secret@db.example.com:5432/myappmysql://root:pass@localhost:3306/analyticssnowflake://user:pass@xy12345.us-east-1/MYDB/PUBLICSyncing databases
Section titled “Syncing databases”Database sources sync all user tables by default. After syncing, tables are accessible as source_name.table_name:
dinobase add postgres --connection-string ... --name productiondinobase syncdinobase query "SELECT * FROM production.users LIMIT 5" --pretty