Search code examples
jdbcsnowflake-cloud-data-platformflyway

Flyway Desktop on MacOS to Snowflake - "no database found" error


I am trying to test Flyway Desktop (v6.5.10.0) on MacOS Ventura 13.4.1, Intel i7, to connect to a Snowflake instance. I have created the project, and gone to "Add target database" in the GUI. The Redgate documentation for Snowflake connections: https://documentation.red-gate.com/fd/snowflake-184127607.html

It explains the URL format is

jdbc:snowflake://account.snowflakecomputing.com/?db=database&warehouse=warehouse&role=role (optionally &schema=schema to specify current schema)

In the JDBC URL field in Flyway Desktop, I have used this string (redacted, of course):

JDBC:snowflake://xx11111.ap-southeast-2.snowflakecomputing.com/?db=DB_NAME&warehouse=WH_NAME&role=ROLE_NAME&schema=SCHEMA

The error I receive when clicking Test Connection is this: "Database connection failed. No database found to handle JDBC:snowflake://xx11111.ap-southeast-2.snowflakecomputing.com/?db=DB_NAME&warehouse=WH_NAME&role=ROLE_NAME&schema=SCHEMA"

I have copy-pasted the database name from the web to this string, so I know that it is correct, as well as the warehouse name, role, and schema.

I have tried changing the case of each segment of the string. I have tried removing the starting JDBC:snowflake:// section, or just the JDBC: part. I have tried connecting to just the SNOWFLAKE database, I've tried the PUBLIC role. Always the same error. It also doesn't matter what I put in the Username or Password fields, so it seems to not even trying to authenticate

I have already connected to this Snowflake instance with VS Code, but that uses SnowSQL, but it seems it's not a network issue.

Is my URL malformed? Do I need a different user with more privileges? Has anyone used Flyway Desktop to connect to a Snowflake instance?


Solution

  • After some help from Redgate support and googling around, I discovered that I needed to do 2 things:

    • Change "JDBC" to "jdbc"
    • Add "&jdbc_query_result_format=json" to the string

    Once I had the form "jdbc:snowflake://xx11111.ap-southeast-2.snowflakecomputing.com/?db=DB_NAME&warehouse=WH_NAME&role=ROLE_NAME&schema=SCHEMA&jdbc_query_result_format=json" it has started working.