Install

Run the following command to install the connector from the root of your project:

npm install --save @latitude-data/snowflake-connector

How to configure sources

The sources files must be inside the queries/ folder.

To know how the source hierarchy works, please, visit How to configure sources.

Configuration

To configure the connection with your Snowflake database follow these steps:

1

Create the source `.yaml` file within the `queries` folder if you haven't already

/queries/source.yml

2

Add the following code for your Snowflake connection

type: snowflake 
details: 
  account: string
  username: string 
  password: string
  token: string
  privateKey: string
  privateKeyPath: string
  privateKeyPass: string 
3

Replace the details section with your info and save

4

Done, now you can test your connection

Attributes

  • Account → The unique identifier for your Snowflake account. It often includes your account name followed by a region and possibly a cloud platform identifier.
  • Username → (Optional) The username for logging into Snowflake.
  • Password → (Optional) The password associated with your username for authentication.
  • Token → (Optional) The authentication token used as an alternative to username/password authentication
  • Private Key → (Optional) In key-pair authentication, this is the private key used to authenticate the connection. Snowflake supports RSA keys as a secure method of authentication without transmitting a password.
  • Private Key Path → (Optional) An alternative to directly providing the private key, this is the filesystem path to the file containing the private key. This method is used in environments where it’s safer or more convenient to reference the key as a file rather than embedding it directly in the code or configuration.
  • Private Key Pass → (Optional) If the private key is encrypted, this is the passphrase used to decrypt it. This adds an additional layer of security to key-pair authentication by protecting the private key with a passphrase.

Test connection

To test the connection you can:

  1. Create a query .sql in the queries directory that points to a table of your new connection in the FROM clause. See the section SQL Syntax Basics to learn more.
  2. Use the command line to run latitude run query_file_name where query_file_name is the name of your .sql file. This will display the results in your terminal. See the section Running queries to learn more about how to query your data.