Skip to main content

Connect Data Warehouse

Evidence supports Google BigQuery, Snowflake, and PostgreSQL.

If you want to try out Evidence with free public datasets, both BigQuery and Snowflake offer a large collection.

Don't have a data warehouse account?

Set up a FREE BigQuery sandbox in less than 60 seconds:

  1. Go to BigQuery
  2. Log in with your Google account (or create one)
  3. Accept the terms of service
  4. Create a project
  5. Click here to see BigQuery's public datasets

BigQuery#

Create a Service Account Key#

  1. Go to the Service Account Page and click on your project
  2. Add a name for your service account, then click Create
  3. Assign your service account a role for BigQuery (scroll down the role dropdown to find BigQuery roles). BigQuery User should work, but it may depend on your organization's permissions settings in Google Cloud. If you run into trouble with permissions, you may need to change this role. Reach out to us if you run into issues or need help with BigQuery permissions.
  4. Click Continue, then click Done. You should see a table of users.
  5. Click on the email address for the service account you just created, then click the Keys tab
  6. Click Add Key, then Create New Key, then Create
  7. Google will download a JSON Key File to your computer

Add JSON Key File into Evidence Project#

Add the JSON file you downloaded from Google to the .evidence folder in your project

Warning for VSCode Users

VSCode combines empty directories in a way that makes it confusing to tell which directory your file is in. Select the right directory by dragging your file directly overtop of .evidence

dbdirectory

Once files are added to these directories, VSCode will split them up to show where the files are stored:

dbdirectory_expanded

Update Database Configuration File#

db-config

  1. Open database.config.json in .evidence folder in your project
  2. Replace "YOUR-JSON-KEY.json" with the name of the file you placed in the .evidence directory
  3. Replace "YOUR-PROJECT-ID" with your project ID supplied by Google (which can be found in your JSON Key file)

Update Evidence Configuration File#

  1. Open evidence.config.json in root of your project
  2. Input your data warehouse name ("bigquery"):
"database":"bigquery"

Snowflake#

Snowflake only requires an account, username, and password to connect through Evidence.

Update Database Configuration File#

  1. Open database.config.json in .evidence folder in your project
  2. Input your credentials:
"account": "xx16244.us-central1.gcp",
"username": "NAME",
"password": "xxxxxx"

Update Evidence Configuration File#

  1. Open evidence.config.json in root of your project.
  2. Input your data warehouse name ("snowflake"):
"database":"snowflake"

PostgreSQL#

Postgres can be connected with basic database credentials. If you run into issues or need another type of auth to connect to your Postgres database, please create a GitHub issue, send us a message in Slack, or send an email to support@evidence.dev.

Update Database Configuration File#

  1. Open database.config.json in .evidence folder in your project
  2. Input your credentials:
"host": "database.server.com",
"database": "my-database-name",
"port": 5432,
"user": "postgres",
"password": "xxxxxx"
  1. [Optional] If your database requires SSL, you can add this option to the config options above:
"ssl": true

By default, ssl will be set to false.

Update Evidence Configuration File#

  1. Open evidence.config.json in root of your project.
  2. Input your database name ("postgres"):
"database":"postgres"

Next Steps#

That's it - now you're ready to start querying some real datasets in Evidence!