Shaounak Nasikkar
Shaounak Nasikkar

Reputation: 314

Using Liquibase with Snowflake

Did anyone try to use the liquibase with Snowflake DW? Trying to create the catalog tables but it's failing while creating the CREATE TABLE STATEMENT. Not sure where the table script is located. I would edit the same. Please let me know if anyone has any idea, else would pull the project from Git and would update the same.

enter image description here

Upvotes: 2

Views: 2424

Answers (3)

Shaounak Nasikkar
Shaounak Nasikkar

Reputation: 314

Figured out finally -

We need to use the extensions for Snowflake -

https://liquibase.jira.com/wiki/spaces/CONTRIB/pages/113372651/Snowflake+extension

Downloaded the jar from the link above and placed it in lib where we place the other DB drivers.

Followed additional steps mentioned in the following GitHub link -

https://github.com/bruce-szalwinski/liquibase-snowflake-sample

Finally, execute the command using the following syntax -

liquibase --databaseClass=liquibase.ext.snowflake.database.SnowflakeDatabase update

The rest of the properties were configured in the liquibase.properties.

Upvotes: 3

user13472370
user13472370

Reputation:

The generated SQL is quite odd in that it appears fully qualified but isn't.

It should read: "ORCL_SDDM_POC"."CUSTOMER"."DATABASECHANGELOGLOCK" instead of "ORCL_SDDM_POC.CUSTOMER.DATABASECHANGELOGLOCK".

Even if you specify the default database and schema as part of the connection parameters, the outcome will appear as an oddly named table within it.

Are you perhaps customizing the databaseChangeLogTableName or databaseChangeLogLockTableName configurations within your liquibase.properties file? I'd recommend removing those if you are, and simply supply ?db=ORCL_SDDM_POC&schema=CUSTOMER&warehouse=YOUR_WH_NAME as part of the Snowflake JDBC URL.

Consider describing what customizations you've performed in the examples/sql directory of your Liquibase download that you are attempting to execute.

Upvotes: 0

Gokhan Atil
Gokhan Atil

Reputation: 10189

As I see, liquidbase expects you to enter a JDBC URL which specifies the database name.

https://docs.liquibase.com/workflows/liquibase-community/creating-config-properties.html

So could you add "db" parameter (and even warehouse parameter) to your URL as it's shown in the following link?

https://docs.snowflake.com/en/user-guide/jdbc-configure.html#examples

Upvotes: 0

Related Questions