sqitchers / sqitch

Sensible database change management

Home Page:https://sqitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use different connection setting for development & production ?

hrkachhia opened this issue · comments

commented

Hello,

As per this document (https://sqitch.org/docs/manual/sqitch-authentication/), Snowflake uses the ~/.snowsql/config file for Snowflake connections, and I have confirmed that this is working fine.

Now, I have a question: I have hosted Snowflake on two different servers, one for development and one for production, and I want Sqitch to use the development connection settings from the configuration file for development and vice versa for production. However, I have not found any examples on how to do this using Sqitch.

Here is my example Sqitch command, and I want to ask how to use a specific connection string:

../docker-sqitch/docker-sqitch.sh deploy 'db:snowflake://username@my_development_host/database?Driver=Snowflake;warehouse=COMPUTE_WH;'

Yes, Sqitch supports only the top-level config from that file, not named configurations. If you have two instances, you should probably set up separate target URIs for them and use the $SQITCH_PASSWORD environment variable for different passwords (assuming you're using password auth). You can also put targets and other config in ~/.sqitch/sqitch.conf to keep it out of your repository.