sqitch-checkout(3pm)

πŸ’– sqitch-checkout πŸ’–

okay so bestie, welcome to sqitch-checkout β€” it's one of the User Contributed Perl Documentation pages, and it's literally the "glow-up your database while switching branches" command. no cap.


✨ NAME ✨

sqitch-checkout β€” revert, checkout another VCS branch, and re-deploy changes. it's giving time-travel but for your database πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

sqitch checkout [options] [<database>] <branch>

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe: you're gonna check out another branch in your project's VCS (think git, https://git-scm.com/), and while you do that, Sqitch also does all the database changes needed to make your database match the new branch. iconic behavior, honestly.

more specifically, checkout compares the plan in the current branch to the plan in the branch you wanna check out, finds the last common changes between the two, reverts to that change as if sqitch revert had been called (unless literally no changes have been deployed since that change, in which case, nothing to undo, slay). then it checks out the new branch, and then deploys all the changes as if sqitch deploy had been called. full main character arc πŸ’…

🫢 heads up: if the VCS is already on the branch you named, nothing happens. it's a no-op, bestie.

the <database> parameter says which database to connect to, and you can also hand it over as the --target option instead. it can be a target name, a URI, an engine name, or a plan file path. dealer's choice ✨


🌈 OPTIONS 🌈

  • -t, --target β€” the target database you wanna connect to. this can be either a URI or the name of a target in the configuration. 🎯
  • --mode β€” specify the reversion mode to use if things go sideways. possible values are:
    • all β€” if there's a failure, revert all deployed changes, all the way back to the point where deployment started. this is the default. πŸ™ˆ
    • tag β€” if there's a failure, revert all deployed changes back to the last successfully-applied tag. and if no tags were applied during this deployment? then all changes get reverted to the point where deployment began. 🏷️
    • change β€” if there's a failure, no changes will be reverted. this is on the assumption that a change is atomic, and thus may may be deployed again. (yes, the original says "may may" and we're keeping it, fr fr 😭)
  • --verify β€” verify each change by running its verify script, if there is one. if a verify test fails, the deploy counts as failed and the appropriate reversion gets carried out, depending on the value of --mode. βœ…
  • --no-verify β€” don't verify each change. this is the default. 🚫
  • -s, --set β€” set a variable name and value for use by the database engine client, if it supports variables. format must be name=value, e.g., --set defuser='Homer Simpson'. overrides any values loaded from Configuration Variables. πŸ“
  • -e, --set-deploy β€” set a variable name and value for use by the database engine client when deploying, if it supports variables. format must be name=value, e.g., --set defuser='Homer Simpson'. overrides any values from --set or values loaded from Configuration Variables. πŸš€
  • -r, --set-revert β€” sets a variable name to be used by the database engine client during when reverting, if it supports variables. (also keeping that "during when", no edits, we respect the source πŸ’œ) format must be name=value, e.g., --set defuser='Homer Simpson'. overrides any values from --set or values loaded from Configuration Variables. βͺ
  • --log-only β€” log the changes as if they were deployed, but without actually running the deploy scripts. useful for an existing database that's being converted to Sqitch, when you need to log changes as deployed because they were deployed by other means in the past. ✍️
  • --lock-timeout β€” set the number of seconds for Sqitch to wait to get an exclusive advisory lock on the target database, for engines that support such a lock. this lock stops other instances of Sqitch from working on the target at the same time, but it prevents no other database activity. defaults to 60. πŸ”’
sqitch checkout --lock-timeout 600
  • -y β€” disable the prompt that normally asks whether or not to execute the revert. yes-queen mode, no questions asked πŸ’…
  • --registry β€” the name of the Sqitch registry schema or database in which sqitch stores its own data. πŸ—‚οΈ
sqitch checkout --registry registry
  • --db-client, --client β€” path to the command-line client for the database engine. defaults to a client in the current path named appropriately for the database engine. 🧰
sqitch checkout --client /usr/local/pgsql/bin/psql
  • -d, --db-name β€” name of the database. in general, targets and URIs are preferred, but this option can be used to override the database name in a target. πŸ“›
sqitch checkout --db-name widgets
sqitch checkout -d bricolage
  • -u, --db-user, --db-username β€” user name to use when connecting to the database. does not apply to all engines. in general, targets and URIs are preferred, but this option can be used to override the user name in a target. πŸ™‹
sqitch checkout --db-username root
sqitch checkout --db-user postgres
sqitch checkout -u Mom
  • -h, --db-host β€” host name to use when connecting to the database. does not apply to all engines. in general, targets and URIs are preferred, but this option can be used to override the host name in a target. 🏠
sqitch checkout --db-host db.example.com
sqitch checkout -h appdb.example.net
  • -p, --db-port β€” port number to connect to. does not apply to all engines. in general, targets and URIs are preferred, but this option can be used to override the port in a target. πŸ”Œ
sqitch checkout --db-port 7654
sqitch checkout -p 5431
  • --plan-file, -f β€” path to the deployment plan file. overrides target, engine, and core configuration values. defaults to $top_dir/sqitch.plan. πŸ“„
sqitch checkout --plan-file my.plan

🧚 CONFIGURATION VARIABLES 🧚

  • [deploy.variables]
  • [revert.variables]

a section defining database client variables. these variables are useful if your database engine supports variables in scripts, such as:

may be overridden by --set, --set-deploy, --set-revert, or target and engine configuration. variables are merged in the following priority order:

  • --set-revert β€” used only while reverting changes.
  • --set-deploy β€” used only while deploying changes.
  • --set β€” used while reverting and deploying changes.
  • target.$target.variables β€” used while reverting and deploying changes.
  • engine.$engine.variables β€” used while reverting and deploying changes.
  • revert.variables β€” used only while reverting changes.
  • deploy.variables β€” used while reverting and deploying changes.
  • core.variables β€” used while reverting and deploying changes.
  • checkout.verify
  • deploy.verify

boolean indicating whether or not to verify each change after deploying it. πŸ•΅οΈ

  • checkout.mode
  • deploy.mode

deploy mode. the supported values are the same as for the --mode option. πŸŽ›οΈ

  • checkout.no_prompt
  • revert.no_prompt

a boolean value indicating whether or not to disable the prompt before executing the revert. the checkout.no_prompt variable takes precedence over revert.no_prompt, and both may of course be overridden by -y. 🀐

  • checkout.prompt_accept
  • revert.prompt_accept

a boolean value indicating whether default reply to the prompt before executing the revert should be yes or no. the checkout.prompt_accept variable takes precedence over revert.prompt_accept, and both default to true, meaning to accept the revert. πŸ‘

  • checkout.strict
  • revert.strict

a boolean value that, when true, disables the checkout command. the checkout.strict variable takes precedence over revert.strict. πŸ›‘

when the checkout command is disabled, use the deploy and revert commands directly.


🌸 SQITCH 🌸

part of the sqitch suite. one big happy family, periodt. πŸ’–


and that's the tea, bestie πŸŽ€ this page came to you via perl v5.40.1, dated 2026-07-26, and it's the sqitch-checkout(3pm) manual. go forth and switch branches with your whole chest πŸ’…βœ¨πŸ¦‹
πŸ“¦ where this page comes from