Snowflake

Supported Versions

  • 5.x versions up to 5.1
  • 4.x versions up to 4.2
  • 3.50 and later 3.x versions

Drivers

URL format jdbc:snowflake://account.snowflakecomputing.com/?db=database&warehouse=warehouse&role=role (optionally &schema=schema to specify current schema)
Maven Central coordinates net.snowflake:snowflake-jdbc:3.6.23
Supported versions 3.6.23 and later
Default Java class net.snowflake.client.jdbc.SnowflakeDriver

SQL Script Syntax

Compatibility

  • DDL exported by the Snowflake web GUI can be used unchanged in a MigrateDB migration
  • Any SQL script executed by MigrateDB, can be executed by the Snowflake web GUI (after the placeholders have been replaced)
  • The Snowflake driver requires Java 8+. There is no support from Snowflake for Java 7 users.

Example

/* Single line comment */
CREATE TABLE test_data (
  value VARCHAR(25) NOT NULL PRIMARY KEY
);

/*
Multi-line
comment
*/

-- Sql-style comment

-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');

Key-based Authentication

Snowflake JDBC supports key-based authentication. To use this, you will need to:

  • ensure you are using at least v3.11 of the Snowflake JDBC driver (MigrateDB currently ships with this version)
  • generate a public/private key pair
  • assign the public key to the relevant Snowflake user account using ALTER USER - for complete instructions on these steps, refer to Snowflake’s documentation

Finally, amend your JDBC connection string with the extra parameters to enable key-based auth and to refer to the location of the private key: authenticator=snowflake_jwt&private_key_file=<absolute-location-of-pem-file>.

Limitations

  • Parallel migrations as described here are unavailable in Snowflake. You can track the status of this feature in our GitHub issues here.

SQLite ➡️