sqitch-target(3pm)
π NAME π
sqitch-target β manage your target database config, bestie. It's the whole vibe of "which database am I even deploying to rn" β¨
β¨ SYNOPSIS β¨
sqitch target
sqitch target [-v | --verbose]
sqitch target add <name> <uri> [-s <property>=<value> ...]
sqitch target alter <name> [-s <property>=<value> ...]
sqitch target remove <name>
sqitch target rename <old> <new>
sqitch target show <name> [...]
π DESCRIPTION π
Okay so basically you've got a whole set of databases you deploy to, and we call them targets. Every single target can carry a bunch of properties, and here's the full list, no skips, no shortcuts π
uriβ the database connection URI for the target. Required, like truly mandatory, you cannot skip this one. Its format is:
db:engine:[dbname]
db:engine:[//[user[:password]@][host][:port]/][dbname][?params][#fragment]
Some examples, for the visual learners:
db:sqlite:widgets.dbdb:pg://dba@example.net/blanketdb:mysql://db.example.com/db:firebird://localhost//tmp/test.fdbdb:clickhouse://default@localhost/default?Driver=ClickHouse
Quick heads up though: same as literally any URI or URL ever, special characters have to be URL encoded (see https://en.wikipedia.org/wiki/URL_encoding). For example, when a username has a reserved character in it β like the | in ro|michelle β you gotta percent-encode it as %7c:
db:pg://ro%7Cmichelle@examle.org/inventory
And the rules get even stricter for query parameters, which ODBC connections use all the time. For example, when you're using a Snowflake identifier (see https://docs.snowflake.com/en/sql-reference/identifiers-syntax#double-quoted-identifiers) with special characters in it β like a warehouse name with a . in it, such as sqitch.dev β the identifier has to be double-quoted π« and double quotes are reserved characters in URIs, so they have to be encoded as %22:
db:snowflake://example/flipr?Driver=Snowflake;warehouse=%22sqitch.dev%22
See URL encoding (https://en.wikipedia.org/wiki/URL_encoding) for the details, and the DB URI Draft (https://github.com/libwww-perl/uri-db) for the in-depth lore on database URIs in general.
registryβ the name of the registry schema or database. Defaults tosqitch.clientβ the command-line client to use. If you don't specify one, each engine goes looking in the OS Path for an appropriate client.top_dirβ the path to the top directory for the target. This directory generally has the plan file in it, plus subdirectories for the deploy, revert, and verify scripts, and also the reworked instances of those scripts. Defaults to., aka the current directory.plan_fileβ the plan file to use for this target. Defaults to$top_dir/sqitch.plan.deploy_dirβ the path to the deploy directory for the target. This one holds all the deploy scripts referenced by changes in theplan_file. Defaults to$top_dir/deploy.revert_dirβ the path to the revert directory for the target. Holds all the revert scripts referenced by changes in theplan_file. Defaults to$top_dir/revert.verify_dirβ the path to the verify directory for the target. Holds all the verify scripts referenced by changes in theplan_file. Defaults to$top_dir/verify.reworked_dirβ the path to the reworked directory for the target. Holds all the subdirectories for all reworked scripts referenced by changes in theplan_file. Defaults to$top_dir.reworked_deploy_dirβ the path to the reworked deploy directory for the target. Holds all the reworked deploy scripts referenced by changes in theplan_file. Defaults to$reworked_dir/deploy.reworked_revert_dirβ the path to the reworked revert directory for the target. Holds all the reworked revert scripts referenced by changes in theplan_file. Defaults to$reworked_dir/revert.reworked_verify_dirβ the path to the reworked verify directory for the target. Holds all the reworked verify scripts referenced by changes in theplan_file. Defaults to$reworked_dir/verify.extensionβ the file name extension you append to change names to build script file names. Defaults tosql.
Every single one of these overrides the corresponding engine-specific configuration that's managed by the engine π§
πΈ OPTIONS πΈ
List Option
-v,--verboseβ be more verbose when listing targets. Example:
sqitch target --verbose
Add and Alter Options
--uriβ specifies the URI (seehttps://github.com/libwww-perl/uri-db/) of the target database.
sqitch target add devwidgets --uri db:pg:widgets
--top-dirβ specifies the top directory to use for the target. Typically it contains the deployment plan file and the change script directories.
sqitch target add devwidgets --top-dir sql
--plan-file,-fβ specifies the path to the deployment plan file. Defaults to$top_dir/sqitch.plan.
sqitch target add devwidgets --plan-file my.plan
--extensionβ specifies the file name extension to use for change script file names. Defaults tosql.
sqitch target add devwidgets --extension ddl
--dirβ sets the path to a script directory. You can specify this one multiple times, go off queen. Supported keys are:deployrevertverifyreworkedreworked_deployreworked_revertreworked_verify
sqitch target add devwidgets --dir deploy=dep --dir revert=rev --dir verify=tst
--registryβ specifies the name of the database object where Sqitch's state and history data lives. Usually that's a schema name (like in PostgreSQL and Oracle) or a database name (like in SQLite and MySQL). Defaults tosqitch.
sqitch target add devwidgets --registry meta
--clientβ specifies the path to the command-line client for the target. Defaults to a client in the current path named appropriately for the engine the URI specifies.
sqitch target add devwidgets --client /usr/local/pgsql/bin/psql
-s,--setβ set a variable name and value for the database engine client to use, if it supports variables. The format has to bename=value, like--set defuser='Homer Simpson'fr fr.
π¦ ACTIONS π¦
With no arguments at all, it shows you a list of the existing targets π Several actions are available to do actual operations on those targets.
add
Add a target named <name> for the database at <uri>. The --set option specifies target-specific properties. A brand new plan file and brand new script directories will be created if they don't already exist β¨
alter
Alter the target named <name>. The --set option specifies engine-specific properties to set. New script directories will be created if they don't already exist.
remove, rm
Remove the target named <name>. Heads up bestie: the plan file and script directories will not be affected. They stay exactly where they are π
rename
Rename the target named <old> to <new>. Glow-up arc, iconic.
show
Gives you some information about the target <name>, including the associated properties. Specify multiple target names and you'll see info for each one.
π CONFIGURATION VARIABLES π
The targets are stored in the configuration file, but the command itself currently relies on no configuration variables. That's it, that's the tea π
β SQITCH β
Part of the sqitch suite π
ngl this whole page is giving go read the other sqitch manpages too energy. See also everything the suite ships with, iykyk.
kisses, bestie π this was documented by way of perl v5.40.1 on 2026-07-26, and that's the whole sqitch-target(3pm) moment. slay, periodt π
β¨
π¦ 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