Demo: Deploy DB Objects in Snowflake using Liquibase CLI

Rajiv Gupta
2 min readAug 21, 2021

In this blog we are going to see a demo on how we can utilize Liquibase, a Database Change Management Tool, to deploy database objects & dml scripts in Snowflake. In my previous blog “Database Change Management Tool: Liquibase with Snowflake Overview”, I tried to give you details on liquibase & its feature. Now it's time to see the same into action.

How about a quick demo?

You can see a few handy syntax below with their usage.

How to see the list of changeset not applied to the database?

liquibase status

How to rollback 1 changeset in liquibase?

liquibase — changeLogFile=<Changelogfilename> rollbackCount 1

How to rollback changeset to certain date in liquibase?

liquibase — changeLogFile=<Changelogfilename> rollbackToDate 2021–01–01

How to rollback changeset to certain tags in liquibase?

liquibase rollback <tag_name>

How to tag changeset in liquibase?

liquibase tag <tag_name>

How to see deployment history in liquibase?

liquibase history

How to see database differences for a particular object type in liquibase?

Here, Source & Target database properties are saved in liquibase properties file.

liquibase — diffTypes=table — outputFile=<outputfile> diff

How to see ChangeLog difference in liquibase?

liquibase — outputFile=mydiff.snowflake.xml diffChangeLog

How to see deploy changes in database using liquibase?

liquibase — changeLogFile=<Changelogfilename>.sql update

liquibase — changeLogFile=<Changelogfilename>.xml update

liquibase — changeLogFile=<Changelogfilename>.json update

liquibase — changeLogFile=<Changelogfilename>.yaml update

liquibase — changeLogFile=<Changelogfilename> updateCount 1

How to Generate Changelog in liquibase?

liquibase — changeLogFile=<Changelogfilename> generateChangeLog

Hope this blog helps you to get insight on Liquibase practical overview and how it works. Feel free to ask a question in the comment section if you have any doubts regarding this. Give a clap if you like the blog. Stay connected to see many more such cool stuff. Thanks for your support.

You Can Find me:

Follow me on Medium: https://rajivgupta780184.medium.com/

Follow me on Twitter: https://twitter.com/RAJIVGUPTA780

Connect with me in LinkedIn: https://www.linkedin.com/in/rajiv-gupta-618b0228/

Subscribe to my YouTube Channel: https://www.youtube.com/channel/UC8Fwkdf2d6-hnNvcrzovktg

#Keep learning #Keep Sharing #EverydayLearning.

References:-

Join FAUN: Website 💻|Podcast 🎙️|Twitter 🐦|Facebook 👥|Instagram 📷|Facebook Group 🗣️|Linkedin Group 💬| Slack 📱|Cloud Native News 📰|More.

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇

--

--

Rajiv Gupta

Sr. Architect at Cognizant, Snowflake Data Super Hero, Snowflake SME