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.
| Database | type |
|---|
| PostgreSQL | postgresql |
| Amazon Redshift | redshift |
| Google BigQuery | bigquery |
| Snowflake | snowflake |
| Databricks | databricks |
| ClickHouse | clickhouse |
| MySQL | mysql |
| Microsoft SQL Server | sqlserver |
| Oracle | oracledb |
| Amazon Athena | aws_athena |
| Presto | prestodb |
| DuckDB | duckdb |
| MotherDuck | motherduck |
Fields marked required must be set. Certificate and key fields take the PEM contents, not a file path.
| Field | Required |
|---|
host | yes |
port | yes |
dbname | yes |
user | yes |
password | |
ssl_root_cert | |
ssl_cert | |
ssl_key | |
| Field | Required | Notes |
|---|
project_id | yes | |
credentials_json | yes | Service account key JSON, as a string |
| Field | Required | Notes |
|---|
host | yes | |
port | yes | |
warehouse | yes | |
dbname | yes | |
user | yes | |
password | | |
private_key | | For key-pair authentication |
oauth_access_token | | For OAuth authentication |
application | | |
| Field | Required |
|---|
host | yes |
port | yes |
http_path | yes |
catalog | yes |
access_token | |
| Field | Required |
|---|
host | yes |
port | yes |
dbname | yes |
user | yes |
password | |
ssl_root_cert | |
| Field | Required |
|---|
host | yes |
port | yes |
dbname | yes |
user | yes |
password | |
| Field | Required |
|---|
host | yes |
port | yes |
service_name | yes |
user | yes |
password | |
| Field | Required |
|---|
region | yes |
access_key_id | yes |
secret_access_key | yes |
result_bucket_url | yes |
database | |
catalog | |
work_group | |
| Field | Required |
|---|
host | yes |
port | yes |
catalog | yes |
user | yes |
password | |
ssl_root_cert | |
| Field | Required | Notes |
|---|
path | | Path to the database file. Defaults to :memory: |
| Field | Required |
|---|
token | yes |
dbname | |
default_dbname | |