Skip to main content

Connecting Snowflake

1. [Optional] Create a Dedicated User with limited access

You can use an already-created username with the necessary schema & database access, or you can create a dedicated user with access limited to the schema & database you wish to use in Motif.

To create a dedicated database user, run the following commands against your database:

-- set variables (these need to be uppercase)
SET MOTIF_ROLE = 'MOTIF_ROLE';
SET MOTIF_USERNAME = 'MOTIF_USER';

-- set user password
SET MOTIF_PASSWORD = '-password-';

BEGIN;

-- create Motif role
CREATE ROLE IF NOT EXISTS $MOTIF_ROLE;

-- create Motif user
CREATE USER IF NOT EXISTS $MOTIF_USERNAME
PASSWORD = $MOTIF_PASSWORD
DEFAULT_ROLE = $MOTIF_ROLE
DEFAULT_WAREHOUSE= $MOTIF_WAREHOUSE;

-- grant MOTIF schema access
GRANT OWNERSHIP ON SCHEMA $MOTIF_SCHEMA TO ROLE $MOTIF_ROLE;

COMMIT;

You can limit this grant down to specific schemas instead of the whole database. Note that to replicate data from multiple Snowflake databases, you can re-run the command above to grant access to all the relevant schemas.

2. Collect & Share Connection parameters

Make note of the following information:

  1. Username The username you created in Step 1 to allow Motif to access the database, or another username with the required access. Example: MOTIF_USER
  2. Host The host domain of the snowflake instance (must include the account, region, cloud environment, and end with snowflakecomputing.com). Example: accountname.us-east-2.aws.snowflakecomputing.com
  3. Role The role you created in Step 1 for Motif to access Snowflake, or another role with sufficient permissions. Example: MOTIF_ROLE
  4. Warehouse The warehouse you created in Step 1 for Motif to sync data into.
  5. Database The database you created in Step 1 for Motif to sync data into.
  6. Schema The schema whose tables this replication is targeting. If no schema is specified, all tables with permission will be presented regardless of their schema.
  7. Username The username you created in Step 2 to allow Motif to access the database. Example: MOTIF_USER
  8. Password The password associated with the username.

Follow instructions to share your data source configuration with Motif.