.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "sqitch-target 3pm" .TH sqitch-target 3pm 2024-02-08 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH Name .IX Header "Name" sqitch-target \- Manage target database configuration .SH Synopsis .IX Header "Synopsis" .Vb 7 \& sqitch target \& sqitch target [\-v | \-\-verbose] \& sqitch target add [\-s = ...] \& sqitch target alter [\-s = ...] \& sqitch target remove \& sqitch target rename \& sqitch target show [...] .Ve .SH Description .IX Header "Description" Manage the set of databases ("targets") you deploy to. Each target may have a number of properties: .ie n .IP """uri""" 4 .el .IP \f(CWuri\fR 4 .IX Item "uri" The database connection URI for the target. Required. Its format is: .Sp .Vb 2 \& db:engine:[dbname] \& db:engine:[//[user[:password]@][host][:port]/][dbname][?params][#fragment] .Ve .Sp Some examples: .RS 4 .ie n .IP """db:sqlite:widgets.db""" 4 .el .IP \f(CWdb:sqlite:widgets.db\fR 4 .IX Item "db:sqlite:widgets.db" .PD 0 .ie n .IP """db:pg://dba@example.net/blanket""" 4 .el .IP \f(CWdb:pg://dba@example.net/blanket\fR 4 .IX Item "db:pg://dba@example.net/blanket" .ie n .IP """db:mysql://db.example.com/""" 4 .el .IP \f(CWdb:mysql://db.example.com/\fR 4 .IX Item "db:mysql://db.example.com/" .ie n .IP """db:firebird://localhost//tmp/test.fdb""" 4 .el .IP \f(CWdb:firebird://localhost//tmp/test.fdb\fR 4 .IX Item "db:firebird://localhost//tmp/test.fdb" .RE .RS 4 .PD .Sp Note that, as with any URI or URL, special characters must be URL encoded . For example, when a username contains a reserved character, such as the \f(CW\*(C`|\*(C'\fR in \f(CW\*(C`ro|michelle\*(C'\fR, it must be percent-encoded as \f(CW%7c\fR: .Sp .Vb 1 \& db:pg://ro%7Cmichelle@examle.org/inventory .Ve .Sp The rules are even more strict for query parameters, as often used by for ODBC connections. For example, when using a Snowflake identifier with special characters, such as a warehouse name with a \f(CW\*(C`.\*(C'\fR, such as \&\f(CW\*(C`sqitch.dev\*(C'\fR, the identifier must be double-quoted \-\-\- and double quote are reserved characters in URIs, so must be encoded as \f(CW%22\fR. .Sp .Vb 1 \& db:snowflake://example/flipr?Driver=Snowflake;warehouse=%22sqitch.dev%22 .Ve .Sp See URL encoding for details. and the DB URI Draft for in-depth information on database URIs in general. .RE .ie n .IP """registry""" 4 .el .IP \f(CWregistry\fR 4 .IX Item "registry" The name of the registry schema or database. The default is \f(CW\*(C`sqitch\*(C'\fR. .ie n .IP """client""" 4 .el .IP \f(CWclient\fR 4 .IX Item "client" The command-line client to use. If not specified, each engine looks in the OS Path for an appropriate client. .ie n .IP """top_dir""" 4 .el .IP \f(CWtop_dir\fR 4 .IX Item "top_dir" The path to the top directory for the target. This directory generally contains the plan file and subdirectories for deploy, revert, and verify scripts, as well as reworked instances of those scripts. The default is \fI.\fR, the current directory. .ie n .IP """plan_file""" 4 .el .IP \f(CWplan_file\fR 4 .IX Item "plan_file" The plan file to use for this target. The default is \f(CW\*(C`$top_dir/sqitch.plan\*(C'\fR. .ie n .IP """deploy_dir""" 4 .el .IP \f(CWdeploy_dir\fR 4 .IX Item "deploy_dir" The path to the deploy directory for the target. This directory contains all of the deploy scripts referenced by changes in the \f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$top_dir/deploy\*(C'\fR. .ie n .IP """revert_dir""" 4 .el .IP \f(CWrevert_dir\fR 4 .IX Item "revert_dir" The path to the revert directory for the target. This directory contains all of the revert scripts referenced by changes in the \f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$top_dir/revert\*(C'\fR. .ie n .IP """verify_dir""" 4 .el .IP \f(CWverify_dir\fR 4 .IX Item "verify_dir" The path to the verify directory for the target. This directory contains all of the verify scripts referenced by changes in the \f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$top_dir/verify\*(C'\fR. .ie n .IP """reworked_dir""" 4 .el .IP \f(CWreworked_dir\fR 4 .IX Item "reworked_dir" The path to the reworked directory for the target. This directory contains all subdirectories for all reworked scripts referenced by changes in the \&\f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW$top_dir\fR. .ie n .IP """reworked_deploy_dir""" 4 .el .IP \f(CWreworked_deploy_dir\fR 4 .IX Item "reworked_deploy_dir" The path to the reworked deploy directory for the target. This directory contains all of the reworked deploy scripts referenced by changes in the \&\f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$reworked_dir/deploy\*(C'\fR. .ie n .IP """reworked_revert_dir""" 4 .el .IP \f(CWreworked_revert_dir\fR 4 .IX Item "reworked_revert_dir" The path to the reworked revert directory for the target. This directory contains all of the reworked revert scripts referenced by changes in the \&\f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$reworked_dir/revert\*(C'\fR. .ie n .IP """reworked_verify_dir""" 4 .el .IP \f(CWreworked_verify_dir\fR 4 .IX Item "reworked_verify_dir" The path to the reworked verify directory for the target. This directory contains all of the reworked verify scripts referenced by changes in the \&\f(CW\*(C`plan_file\*(C'\fR. The default is \f(CW\*(C`$reworked_dir/verify\*(C'\fR. .ie n .IP """extension""" 4 .el .IP \f(CWextension\fR 4 .IX Item "extension" The file name extension to append to change names to create script file names. The default is \f(CW\*(C`sql\*(C'\fR. .PP Each of these overrides the corresponding engine-specific configuration managed by engine. .SH Options .IX Header "Options" .IP "List Option" 4 .IX Item "List Option" .RS 4 .PD 0 .ie n .IP """\-v""" 4 .el .IP \f(CW\-v\fR 4 .IX Item "-v" .ie n .IP """\-\-verbose""" 4 .el .IP \f(CW\-\-verbose\fR 4 .IX Item "--verbose" .PD .Vb 1 \& sqitch target \-\-verbose .Ve .Sp Be more verbose when listing targets. .RE .RS 4 .RE .IP "Add and Alter Options" 4 .IX Item "Add and Alter Options" .RS 4 .PD 0 .ie n .IP """\-\-uri""" 4 .el .IP \f(CW\-\-uri\fR 4 .IX Item "--uri" .PD .Vb 1 \& sqitch target add devwidgets \-\-uri db:pg:widgets .Ve .Sp Specifies the URI of the target database. .ie n .IP """\-\-top\-dir""" 4 .el .IP \f(CW\-\-top\-dir\fR 4 .IX Item "--top-dir" .Vb 1 \& sqitch target add devwidgets \-\-top\-dir sql .Ve .Sp Specifies the top directory to use for the target. Typically contains the deployment plan file and the change script directories. .ie n .IP """\-\-plan\-file""" 4 .el .IP \f(CW\-\-plan\-file\fR 4 .IX Item "--plan-file" .PD 0 .ie n .IP """\-f""" 4 .el .IP \f(CW\-f\fR 4 .IX Item "-f" .PD .Vb 1 \& sqitch target add devwidgets \-\-plan\-file my.plan .Ve .Sp Specifies the path to the deployment plan file. Defaults to \&\f(CW\*(C`$top_dir/sqitch.plan\*(C'\fR. .ie n .IP """\-\-extension""" 4 .el .IP \f(CW\-\-extension\fR 4 .IX Item "--extension" .Vb 1 \& sqitch target add devwidgets \-\-extension ddl .Ve .Sp Specifies the file name extension to use for change script file names. Defaults to \f(CW\*(C`sql\*(C'\fR. .ie n .IP """\-\-dir""" 4 .el .IP \f(CW\-\-dir\fR 4 .IX Item "--dir" .Vb 1 \& sqitch target add devwidgets \-\-dir deploy=dep \-\-dir revert=rev \-\-dir verify=tst .Ve .Sp Sets the path to a script directory. May be specified multiple times. Supported keys are: .RS 4 .IP \(bu 4 \&\f(CW\*(C`deploy\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`revert\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`verify\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`reworked\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`reworked_deploy\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`reworked_revert\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`reworked_verify\*(C'\fR .RE .RS 4 .RE .ie n .IP """\-\-registry""" 4 .el .IP \f(CW\-\-registry\fR 4 .IX Item "--registry" .Vb 1 \& sqitch target add devwidgets \-\-registry meta .Ve .Sp Specifies the name of the database object where Sqitch's state and history data is stored. Typically a schema name (as in PostgreSQL and Oracle) or a database name (as in SQLite and MySQL). Defaults to \f(CW\*(C`sqitch\*(C'\fR. .ie n .IP """\-\-client""" 4 .el .IP \f(CW\-\-client\fR 4 .IX Item "--client" .Vb 1 \& sqitch target add devwidgets \-\-client /usr/local/pgsql/bin/psql .Ve .Sp Specifies the path to the command-line client for the target. Defaults to a client in the current path named appropriately for the engine specified by the URI. .ie n .IP """\-s""" 4 .el .IP \f(CW\-s\fR 4 .IX Item "-s" .PD 0 .ie n .IP """\-\-set""" 4 .el .IP \f(CW\-\-set\fR 4 .IX Item "--set" .PD Set a variable name and value for use by the database engine client, if it supports variables. The format must be \f(CW\*(C`name=value\*(C'\fR, e.g., \&\f(CW\*(C`\-\-set defuser=\*(AqHomer Simpson\*(Aq\*(C'\fR. .RE .RS 4 .RE .SH Actions .IX Header "Actions" With no arguments, shows a list of existing targets. Several actions are available to perform operations on the targets. .ie n .SS """add""" .el .SS \f(CWadd\fP .IX Subsection "add" Add a target named \f(CW\*(C`\*(C'\fR for the database at \f(CW\*(C`\*(C'\fR. The \&\f(CW\*(C`\-\-set\*(C'\fR option specifies target-specific properties. A new plan file and new script script directories will be created if they don't already exist. .ie n .SS """alter""" .el .SS \f(CWalter\fP .IX Subsection "alter" Alter target named \f(CW\*(C`\*(C'\fR. The \f(CW\*(C`\-\-set\*(C'\fR option specifies engine-specific properties to set. New script script directories will be created if they don't already exist. .ie n .SS """remove"", ""rm""" .el .SS "\f(CWremove\fP, \f(CWrm\fP" .IX Subsection "remove, rm" Remove the target named \f(CW\*(C`\*(C'\fR. The plan file and script directories will not be affected. .ie n .SS """rename""" .el .SS \f(CWrename\fP .IX Subsection "rename" Rename the target named \f(CW\*(C`\*(C'\fR to \f(CW\*(C`\*(C'\fR. .ie n .SS """show""" .el .SS \f(CWshow\fP .IX Subsection "show" Gives some information about the target \f(CW\*(C`\*(C'\fR, including the associated properties. Specify multiple target names to see information for each. .SH "Configuration Variables" .IX Header "Configuration Variables" The targets are stored in the configuration file, but the command itself currently relies on no configuration variables. .SH Sqitch .IX Header "Sqitch" Part of the sqitch suite.