Reputation: 3691
Using liquibase 3.8.0, I am trying to look for differences between two Snowflake databases
For simplicity, I use a liquibase.properties file as follows
driver: net.snowflake.client.jdbc.SnowflakeDriver
classpath: liquibase-snowflake-1.0.jar
url: jdbc:snowflake://XXXXX.snowflakecomputing.com/?db=MyDB1&warehouse=MyWarehouse&role=SYSADMIN
username: MyLogin
password: MyPassword
referenceUrl: jdbc:snowflake://XXXXX.snowflakecomputing.com/?db=MyDB2&warehouse=MyWarehouse&role=SYSADMIN
referenceUsername: MyLogin
referencePassword: MyPassword
referenceDriver: net.snowflake.client.jdbc.SnowflakeDriver
I do specify a different database in each case: MyDB1 & MyDB2
In the same folder, I run the command liquibase diff
Then I get the following answer...
Starting Liquibase at Tue, 05 Nov 2019 11:38:39 GMT (version 3.8.0 built at 2019-08-15T20:38:06Z)
Liquibase Community 3.8.0 by Datical
Diff Results:
Reference Database: eric.mamet @ jdbc:snowflake://XXXXX.snowflakecomputing.com/
Comparison Database: eric.mamet @ jdbc:snowflake://XXXXX.snowflakecomputing.com/
Compared Schemas:
Product Name: EQUAL
Product Version: EQUAL
Missing Catalog(s): NONE
Unexpected Catalog(s): NONE
Changed Catalog(s): NONE
Missing Check Constraint(s): NONE
Unexpected Check Constraint(s): NONE
Changed Check Constraint(s): NONE
Missing Column(s): NONE
Unexpected Column(s): NONE
Changed Column(s): NONE
Missing Database Package(s): NONE
Unexpected Database Package(s): NONE
Changed Database Package(s): NONE
Missing Database Package Body(s): NONE
Unexpected Database Package Body(s): NONE
Changed Database Package Body(s): NONE
Missing Foreign Key(s): NONE
Unexpected Foreign Key(s): NONE
Changed Foreign Key(s): NONE
Missing Function(s): NONE
Unexpected Function(s): NONE
Changed Function(s): NONE
Missing Index(s): NONE
Unexpected Index(s): NONE
Changed Index(s): NONE
Missing Primary Key(s): NONE
Unexpected Primary Key(s): NONE
Changed Primary Key(s): NONE
Missing Schema(s): NONE
Unexpected Schema(s): NONE
Changed Schema(s): NONE
Missing Sequence(s): NONE
Unexpected Sequence(s): NONE
Changed Sequence(s): NONE
Missing Stored Procedure(s): NONE
Unexpected Stored Procedure(s): NONE
Changed Stored Procedure(s): NONE
Missing Table(s): NONE
Unexpected Table(s): NONE
Changed Table(s): NONE
Missing Trigger(s): NONE
Unexpected Trigger(s): NONE
Changed Trigger(s): NONE
Missing Unique Constraint(s): NONE
Unexpected Unique Constraint(s): NONE
Changed Unique Constraint(s): NONE
Missing View(s): NONE
Unexpected View(s): NONE
Changed View(s): NONE
Liquibase command 'diff' was executed successfully.
I am "worried" about the first two lines of the output...
Could it be that he ignores my ?db=
parameters in the URLs?
Am I missing something fundamental???
Upvotes: 0
Views: 754
Reputation: 326
Liquibase does not AFAIK support Snowflake. In terms of metadata, Snowflake works mostly like Postgres so you might want to try that. I looked at adding support to Liquibase for Snowflake and found that the codebase doesn't allow for easily adding additional database support. I eventually went to Flyway for Snowflake schema management. I know that doesn't really answer your question but wanted to share as background.
Upvotes: 0
Reputation: 2940
I can't speak to LiquidBase's output, but I can tell you the best way to check this IMO is to review the SQL commands issued by LiquidBase, to check to see if the context has switched from one database to another.
To do that, review the query history of that user's sessions in the SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY view. The view has fields to tell you the context of the queries that were executed, such as role, warehouse, database name, and schema name.
Knowing the context of the queries will inform you of what is exactly happening on the back end, and will give you quite a bit more confidence in the output of the tool. Hopefully you will see the same queries running, but under different databases and maybe even schemas, if that's what you want.
Speaking of schemas, I'm surprised you don't have them called out in your JDBC URL, that's another thing I'd check. The db=dbNameHere looks correct to me though.
A link to the docs on query history is here:
https://docs.snowflake.net/manuals/sql-reference/account-usage/query_history.html#query-history-view
I hope this helps...Rich
Upvotes: 1