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 bename=value, e.g.,--set defuser='Homer Simpson'. overrides any values loaded fromConfiguration 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 bename=value, e.g.,--set defuser='Homer Simpson'. overrides any values from--setor values loaded fromConfiguration 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 bename=value, e.g.,--set defuser='Homer Simpson'. overrides any values from--setor values loaded fromConfiguration 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 to60. π
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:
- PostgreSQL's
psqlvariables β https://www.postgresql.org/docs/current/static/app-psql.html#APP-PSQL-INTERPOLATION - Vertica's
vsqlvariables β https://docs.vertica.com/24.2.x/en/connecting-to/using-vsql/variables/ - MySQL's user variables β https://dev.mysql.com/doc/refman/5.6/en/user-variables.html
- SQL*Plus's
DEFINEvariables β https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12017.htm - Snowflake's SnowSQL variables β https://docs.snowflake.com/en/user-guide/snowsql-use.html#using-variables
- ClickHouse's queries with parameters β https://clickhouse.com/docs/interfaces/cli#cli-queries-with-parameters
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.verifydeploy.verify
boolean indicating whether or not to verify each change after deploying it. π΅οΈ
checkout.modedeploy.mode
deploy mode. the supported values are the same as for the --mode option. ποΈ
checkout.no_promptrevert.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_acceptrevert.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.strictrevert.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 viaperl v5.40.1, dated2026-07-26, and it's thesqitch-checkout(3pm)manual. go forth and switch branches with your whole chest π β¨π¦
π¦ where this page comes from
- ubuntu stonking: sqitch 1.6.1-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms