Skip to main content

depot.properties

A depot.properties file is used to setup Snowflake connection and credentials. It is picked up by various Depot tests (e.g. Snowflake tests or Depot-local).

The file should be placed in the working directory (or some parent directory to make it easier in monorepos).

At a glance, the properties file looks like this:

environmentName=xyztest
sql.dialect=snowflake
sql.connection=jdbc:snowflake://aa12345.eu-west-1.snowflakecomputing.com
sql.database=EXAMPLE_DB
sql.warehouse=EXAMPLE_WAREHOUSE
sql.username=EXAMPLE_USER
sql.privateKey=MIIEvgIBA[EXAMPLE]wEcK
aws.profile=my-profile
aws.region=eu-west-1

The sql.connection entry can contain a Snowflake URL with account identifier, e.g. sql.connection=jdbc:snowflake://org-acc.snowflakecomputing.com.

The Snowflake account + region could be specified explicitly instead of sql.connection, via sql.accountId and sql.region:

...
sql.accountId=aa12345
sql.region=eu-west-1
info

An alternative configuration for credentials is to specify an AWS Secrets Manager credential ARN via sql.credentialsSecretArn. The secret must contain username, password and privateKey entries.

caution

Configuration via sql.credentialsSecretArn might not be supported everywhere and would require AWS access.

environmentName=xyztest
sql.dialect=snowflake
sql.connection=jdbc:snowflake://aa12345.eu-west-1.snowflakecomputing.com
sql.database=EXAMPLE_DB
sql.warehouse=EXAMPLE_WAREHOUSE
sql.credentialsSecretArn=arn:aws:secretsmanager:eu-west-1:123456789012:secret:ws-example-snowflake-credentials-O72rNM
aws.profile=my-profile
aws.region=eu-west-1

You can read more about the test configuration and options in the stage-depot/packages/depot-test repository README.md.

Pointing at a local Snowflake endpoint​

sql.endpointOverride redirects both Snowflake transports — the SQL API and the JDBC driver — at a base URL of your choosing, instead of the *.snowflakecomputing.com host derived from sql.accountId and sql.region:

sql.dialect=snowflake
sql.endpointOverride=http://localhost:64616
sql.accountId=fakesnow
sql.username=fake
sql.password=snow
sql.database=EXAMPLE_DB
sql.warehouse=EXAMPLE_WAREHOUSE

An http:// scheme disables TLS for the JDBC connection, so a plain-HTTP local endpoint works. sql.accountId is still required: the JDBC driver cannot derive an account from a bare host, so the value is passed through in the connection URL. It is not otherwise meaningful when the endpoint is local. The equivalent environment variable is SNOWFLAKE_ENDPOINT_OVERRIDE.

info

This is an escape hatch for an endpoint you run and manage — typically a fakesnow instance you started yourself to attach a debugger to, or to keep warm across many test runs.

For the ordinary case of "run this suite against fakesnow", prefer the managed flavour: the FAKESNOW location type for a Depot Test suite, or Depot Local's fakesnow config for a Depot Local one. Both own the container's lifecycle and need no depot.properties at all.

caution

Setting endpointOverride at all disables Depot's JDBC view-DDL check, which compares each view's stored definition against the text Depot submitted. Only Snowflake echoes that text verbatim, and an arbitrary endpoint may serve the SQL API without being a full JDBC session peer at all. CONTENTS checks are unaffected — they go over the SQL API and compare data.

Generate in CI​

In CI/build settings, the depot.properties file can be generated by using depot-generate-properties binary in @stage-tech/depot-test package:

npx depot-generate-properties \
--sql-database ${{ secrets.SFK_DATABASE }} \
--sql-username ${{ secrets.SFK_USERNAME }} \
--sql-private-key ${{ secrets.SFK_PRIVATE_KEY }}

Workstation: profiles​

Sometimes you need to rapidly switch between different sets of parameters and setting up (and flipping between) multiple sets of environment variables is not convenient as it requires you to update the environment variables section in your IDE or terminal.

You can set up profiles using the profiles.# section in the depot.properties file:

profiles.0.id=keep
profiles.0.title="Keep Schema" profile
profiles.0.keepSchema=true
profiles.1.id=red
profiles.1.title="Red" profile
profiles.1.schemaPrefix=BLUE_
profiles.2.id=green
profiles.2.title="Green" profile
profiles.2.schemaPrefix=GREEN_
profiles.3.id=blank
profiles.3.title="Blank prefix" profile
profiles.3.schemaPrefix=

The # part in profiles.# should be a sequentially increasing number starting from 0. Each profile is defined by an id field and one or more other fields according to the table in parameters.