Skip to content

Manage one database per git branch #626

Answered by theory
angererc asked this question in Q&A
Discussion options

You must be logged in to vote

Most engines support environment variables and defaults that specify database connection information. Postgres, for example, will fall back on your local username as the database name and username. So if you set a target like this:

sqitch add target local-dev db:pg:localhost/

Then for a user named bob it would connect to db:pg:localhost/bob and for a user named sue it would connect to db:pg:localhost/sue. All you have to do is remember to use it each time

sqitch deploy local-dev

Or set $SQITCH_TARGET to that target:

export SQITCH_TARGET=local-dev
sqitch deploy # uses local-dev

Of course, if you're setting environment variables, you can just do that generally, esp if youre engine doesn't n…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@angererc
Comment options

@theory
Comment options

Answer selected by angererc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants