Data source parameters
The connection parameters each supported source type accepts, and which of them the agent requires.
The database types take the same five required parameters, plus their own optional extras. The warehouse types do not: BigQuery is reached over Google's API rather than a database connection, and Snowflake identifies an account rather than a host, so each takes its own set entirely.
A value written without quotes is read as a number, so password: 12345 is rejected and private_key_passphrase: 007 silently loses its leading zeros. Write "12345" and "007". This applies to every parameter on this page.
Parameters the database types need
Required for database_postgres and database_mysql. Leave one of these out and the connection fails with missing required param.
port is validated as a number, so port: "5432" fails with port must be a number. It is easy to miss in a file where every neighbouring value is a string.
PostgreSQL
Set type: database_postgres. One optional parameter on top of the five above.
sources:
- name: orders_db
type: database_postgres
params:
host: db.internal
port: 5432
user: vaurd
password: <password>
database: orders
sslmode: requireThe default of disable means the connection is not encrypted. Set it to require or stricter for anything crossing a network you do not fully control.
MySQL
Set type: database_mysql. Two optional parameters on top of the five above.
sources:
- name: inventory_db
type: database_mysql
params:
host: mysql.internal
port: 3306
user: vaurd
password: <password>
database: inventory
tls: trueGoogle BigQuery
Set type: datawh_bigquery. None of the five parameters above apply: there is no host to reach or database to open, only a project to bill the query to. One parameter is required.
The rest are optional.
Authentication
The agent takes the first of these it finds:
credentials_json, if set.credentials_file, if set.- Application Default Credentials, when neither is set.
Whichever you use, the service account needs roles/bigquery.jobUser on the project named by project_id to run queries, and roles/bigquery.dataViewer on each dataset it reads.
The credential is always read as a service account key. Credential configurations of other kinds, including externally sourced ones that resolve a token from a URL are rejected.
Location has to match the dataset
If location does not match where the dataset actually lives, BigQuery rejects the query. Find the dataset's region under Dataset info in the BigQuery console. Multi-regions are uppercase (EU, US); single regions are lowercase (europe-west3).
What a query returns
Column types are reported with BigQuery's own spellings, which are its legacy ones: INTEGER for INT64, FLOAT for FLOAT64, BOOLEAN for BOOL and RECORD for STRUCT. A repeated column reports as ARRAY<INTEGER>.
Values are converted so a fetch node can work with them:
INT64 is returned as a number, so a value above 9,007,199,254,740,992 is rounded. If a column holds identifiers larger than that, cast it in the query: SELECT CAST(id AS STRING) AS id.
sources:
- name: events_warehouse
type: datawh_bigquery
params:
project_id: acme-analytics
location: EU
maximum_bytes_billed: 10737418240
credentials_file: /etc/vaurd/bigquery-key.jsonOn Google Cloud, leave both credential keys out and let the attached service account be used:
sources:
- name: events_warehouse
type: datawh_bigquery
params:
project_id: acme-analytics
location: EUBigQuery bills for bytes scanned, so a SELECT * on a wide table is charged for every column even if the query has a LIMIT. Setting maximum_bytes_billed caps what any one fetch node can cost. To pick a number, run the query once in the BigQuery console and read the estimate it shows before running.
Snowflake
Set type: datawh_snowflake. Snowflake identifies an account rather than a host, so none of the five database parameters apply. Two are required.
Plus exactly one credential, covered below, and these optional settings.
Authentication
Three separate mechanisms, not three forms of one credential, so setting more than one is an error rather than a precedence. A config carrying both a password and a token is a mistake worth surfacing rather than silently resolving.
Key-pair is what Snowflake documents for service accounts and the one to prefer.
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes-256-cbc -inform PEM -out rsa_key.p8 openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
ALTER USER vaurd_svc SET RSA_PUBLIC_KEY='<body of rsa_key.pub, without the header and footer lines>';
Encrypted and unencrypted keys both work. Snowflake accepts a second key on RSA_PUBLIC_KEY_2, which is how you rotate without downtime.
Programmatic access token (PAT), scoped to a user and role, with an expiry to rotate before.
Password, via a single password parameter. The quickest way to try a source, but Snowflake is moving service accounts off single-factor passwords, and a user with MFA enforced cannot connect this way.
private_key holds a multi-line PEM, so it only survives with a | block. A quoted single-line string loses the line breaks and fails to parse.
private_key: | -----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkq... -----END PRIVATE KEY-----
What a query returns
Column types carry the driver's own names, so a NUMBER column reports as FIXED and VARCHAR as TEXT.
NUMBER with scale 0 is returned as a number, so a value above 9,007,199,254,740,992 is rounded. NUMBER(38,0) is the default, so identifier columns are the usual casualty. Cast them in the query: SELECT CAST(ID AS VARCHAR) AS ID.
sources:
- name: sales_warehouse
type: datawh_snowflake
params:
account: "MYORG-MYACCOUNT"
user: "VAURD_SVC"
warehouse: "COMPUTE_WH"
database: "ANALYTICS"
schema: "PUBLIC"
role: "VAURD_READER"
private_key_file: "/etc/vaurd/snowflake_key.p8"
private_key_passphrase: "<passphrase>"The user needs a role with USAGE on the warehouse and read access to whatever the query touches.