Anfra docs
Anfra Self-Hosted

Data Sources

Connect Anfra to your warehouse with data_sources.yml

Anfra reads warehouse connections from .anfra/data_sources.yml in your project. Each entry has a name, a type, and a connection block:

# .anfra/data_sources.yml
data_sources:
  warehouse:
    type: postgresql
    connection:
      host: localhost
      port: 5432
      user: anfra
      password: anfra
      dbname: analytics

The name (warehouse above) is how your models refer to the data source. You can define more than one.

Keep this file out of version control: it holds credentials.

Supported types

Databasetype
PostgreSQLpostgresql
Amazon Redshiftredshift
Google BigQuerybigquery
Snowflakesnowflake
Databricksdatabricks
ClickHouseclickhouse
MySQLmysql
Microsoft SQL Serversqlserver
Oracleoracledb
Amazon Athenaaws_athena
Prestoprestodb
DuckDBduckdb
MotherDuckmotherduck

Connection fields

Fields marked required must be set. Certificate and key fields take the PEM contents, not a file path.

PostgreSQL and Redshift

FieldRequired
hostyes
portyes
dbnameyes
useryes
password
ssl_root_cert
ssl_cert
ssl_key

BigQuery

FieldRequiredNotes
project_idyes
credentials_jsonyesService account key JSON, as a string

Snowflake

FieldRequiredNotes
hostyes
portyes
warehouseyes
dbnameyes
useryes
password
private_keyFor key-pair authentication
oauth_access_tokenFor OAuth authentication
application

Databricks

FieldRequired
hostyes
portyes
http_pathyes
catalogyes
access_token

ClickHouse

FieldRequired
hostyes
portyes
dbnameyes
useryes
password
ssl_root_cert

MySQL and SQL Server

FieldRequired
hostyes
portyes
dbnameyes
useryes
password

Oracle

FieldRequired
hostyes
portyes
service_nameyes
useryes
password

Amazon Athena

FieldRequired
regionyes
access_key_idyes
secret_access_keyyes
result_bucket_urlyes
database
catalog
work_group

Presto

FieldRequired
hostyes
portyes
catalogyes
useryes
password
ssl_root_cert

DuckDB

FieldRequiredNotes
pathPath to the database file. Defaults to :memory:

MotherDuck

FieldRequired
tokenyes
dbname
default_dbname

On this page