sqitch-config(3pm)
sqitch-config(3pm) β User Contributed Perl Documentation π
β¨ NAME β¨
sqitch-config β get and set local, user, or system Sqitch options. It's giving config queen. π
π SYNOPSIS π
sqitch config [<file-option>] [type] name [value [value_regex]]
sqitch config [<file-option>] [type] --add name value
sqitch config [<file-option>] [type] --replace-all name value [value_regex]
sqitch config [<file-option>] [type] --get name [value_regex]
sqitch config [<file-option>] [type] --get-all name [value_regex]
sqitch config [<file-option>] [type] --get-regexp name_regex [value_regex]
sqitch config [<file-option>] --unset name [value_regex]
sqitch config [<file-option>] --unset-all name [value_regex]
sqitch config [<file-option>] --rename-section old_name new_name
sqitch config [<file-option>] --remove-section name
sqitch config [<file-option>] -l | --list
sqitch config [<file-option>] -e | --edit
π DESCRIPTION π
Okay bestie, so sqitch config is your one-stop shop to query, set, replace, or unset Sqitch options. The <name> you pass is actually the section and the key separated by a dot, and the value gets escaped. Periodt.
You can add multiple lines to an option by using the --add option. If you wanna update or unset an option that can appear on multiple lines, you gotta give a Perl regular expression <value_regex>. Only the existing values that match that regex get updated or unset. And if you wanna handle lines that don't match the regex, just prepend a single ! (exclamation point) in front of it (see Examples). No cap.
The <type> specifier can be --int, --num, or --bool, to make sure the variable(s) are of that given type and convert the value to the canonical form: simple integer for --int, decimal number for --num, and a true or false string for --bool. If you don't pass a type specifier, no checks or transformations happen on the value. It's giving raw.
The <file-option> can be one of --local, --user, --system, or --file. Those tell it where the values will be read from or written to. The default is to assume the local config file in the current project directory for editing, and all files merged for fetching (see "Files"). Slay.
On success, the command returns the exit code 0. π
β¨ OPTIONS β¨
--replace-allβ The default behavior is to replace at most one line. This one replaces all lines matching the key (and optionally the<value_regex>). Go off.--addβ Adds a new line to the option without altering any existing values. This is the same as providing^$as the<value_regex>in--replace-all.--getβ Get the value for a given key (optionally filtered by a regex matching the value). Returns error code1if the key was not found and error code2if multiple values were found. π--get-allβ Like--get, but does not fail if the number of values for the key is not exactly one. Chill.--get-regexpβ Like--get-all, but interprets the name as a regular expression and writes out the key names and value.--localβ For writing options: write to the local./sqitch.conffile. This is the default if no file option is specified. For reading options: read only from the local./sqitch.conffile rather than from all available files. See also "Files".--userβ For writing options: write to the user~/.sqitch/sqitch.conffile rather than the repository./sqitch.conf. For reading options: read only from the user~/.sqitch/sqitch.conffile rather than from all available files. See also "Files".--globalβ An alias for--userfor the benefit of the muscle memory of Git users. We see you, Git girlies.--systemβ For writing options: write to system-wide$(prefix)/etc/sqitch/sqitch.conffile rather than the repository./sqitch.conf. For reading options: read only from system-wide$(prefix)/etc/sqitch/sqitch.conffile rather than from all available files. Callsqitch --etc-pathto find out exactly where the system configuration file lives (e.g.,$(sqitch --etc-path)/sqitch.conf). See also "Files".-f config-file,--file config-fileβ Use the given config file instead of the one specified by$SQITCH_CONFIG.--remove-sectionβ Remove the given section from the configuration file.--rename-sectionβ Rename the given section to a new name.--unsetβ Remove the line matching the key from config file.--unset-allβ Remove all lines matching the key from config file.-l,--listβ List all variables set in config file.--boolβsqitch configwill ensure that the output istrueorfalse.--intβsqitch configwill ensure that the output is a simple integer.--numβsqitch configwill ensure that the output is a simple decimal number.--bool-or-intβsqitch configwill ensure that the output matches the format of either--boolor--int, as described above.-e,--editβ Opens an editor to modify the specified config file; either--local,--user,--system, or--file. If none of those options is specified, the local file will be opened.
π FILES π
If not set explicitly with --file, there are three files in which sqitch config will search for configuration options:
./sqitch.confβ Local, project-specific configuration file.~/.sqitch/sqitch.confβ User-specific configuration file.$(prefix)/etc/sqitch/sqitch.confβ System-wide configuration file.
π ENVIRONMENT π
SQITCH_CONFIGβ Take the local configuration from the given file instead of./sqitch.conf.SQITCH_USER_CONFIGβ Take the user configuration from the given file instead of~/.sqitch/sqitch.conf.SQITCH_SYSTEM_CONFIGβ Take the system configuration from the given file instead of$($etc_prefix)/sqitch.conf.
π EXAMPLES π
Given a ./sqitch.conf like this:
#
# This is the config file, and
# a '#' or ';' character indicates
# a comment
#
; core variables
[core]
; Use PostgreSQL
engine = pg
; Bundle command settings.
[bundle]
from = gamma
tags_only = false
dest_dir = _build/sql
; Fuzzle command settings
[core "fuzzle"]
clack = foo
clack = bar
clack = barzlewidth
You can set the tags_only setting to true with
% sqitch config bundle.tags_only true
The hypothetical clack key in the core.fuzzle section might need to set foo to hi instead of foo. You can make the replacement by passing an additional argument to match the old value, which will be evaluated as a regular expression. Here's one way to make that change:
% sqitch config core.fuzzle.clack hi '^foo$'
To delete the entry for bundle.from, do
% sqitch config --unset bundle.from
If you want to delete an entry for a multivalue setting (like core.fuzzle.clack), provide a regex matching the value of exactly one line. This example deletes the bar value:
% sqitch config --unset core.fuzzle.clack '^bar$'
To query the value for a given key, do:
% sqitch config --get core.engine
Or:
% sqitch config core.engine
Or, to query a multivalue setting for only those values that match /ba/:
% sqitch config --get core.fuzzle.clack ba
If you want to know all the values for a multivalue setting, do:
% sqitch config --get-all core.fuzzle.clack
If you like to live dangerously, you can replace all core.fuzzle.clack with a new one with
% sqitch config --replace-all core.fuzzle.clack funk
However, if you only want to replace lines that don't match bar, prepend the matching regular expression with an exclamation point (!), like so:
% sqitch config --replace-all core.fuzzle.clack yow '!bar'
To match only values with an exclamation mark, you have to escape it:
% sqitch config section.key '[!]'
To add a new setting without altering any of the existing ones, use:
% sqitch config --add core.fuzzle.set widget=fred
π CONFIGURATION FILE π
The sqitch configuration file contains a number of variables that affect the sqitch command's behavior. The ./sqitch.conf file local to each project is used to store the configuration for that project, and $HOME/.sqitch/sqitch.conf is used to store a per-user configuration as fallback values for the ./sqitch.conf file. The file $($etc_prefix)/sqitch.conf can be used to store a system-wide default configuration.
The variables are divided into sections, wherein the fully qualified variable name of the variable itself is the last dot-separated segment and the section name is everything before the last dot. The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character. Some variables may appear multiple times. Iykyk.
π€ SYNTAX π€
The syntax is fairly flexible and permissive; white space is mostly ignored. The # and ; characters begin comments to the end of line, blank lines are ignored. So lax, we love.
The file consists of sections and variables. A section begins with the name of the section in square brackets and continues until the next section begins. Section names are not case sensitive. Only alphanumeric characters, - and . are allowed in section names. Each variable must belong to some section, which means that there must be a section header before the first setting of a variable. No skipping, bestie.
Sections can be further divided into subsections. To begin a subsection put its name in double quotes, separated by space from the section name, in the section header, like in the example below:
[section "subsection"]
Subsection names are case sensitive and can contain any characters except newline (double quote and backslash have to be escaped as "\"" and "\\", respectively). Section headers cannot span multiple lines. Variables may belong directly to a section or to a given subsection. You can have [section] if you have [section "subsection"], but you don't need to. It's giving flexible.
All the other lines (and the remainder of the line after the section header) are recognized as setting variables, in the form name = value. If there is no equal sign on the line, the entire line is taken as name and the variable is recognized as boolean true. The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character. There can be more than one value for a given variable; we say then that the variable is multivalued.
Leading and trailing whitespace in a variable value is discarded. Internal whitespace within a variable value is retained verbatim. Facts only. π―
Okay so boom π₯ β the values that come after the equals sign in a variable assignment are one of: strings, integers, numbers, or booleans. Booleans can be written as yes/no, 1/0, true/false or on/off. Case does not matter for boolean values when you're converting the value to the canonical form using the --bool type specifier, and sqitch config will make absolutely sure the output is true or false. Periodt. π
String values may be entirely or partially wrapped in double quotes. And bestie you need those double quotes if you wanna preserve leading or trailing whitespace, or if your variable value contains comment characters (i.e. it contains # or ;). Double quote and backslash characters inside variable values must be escaped: use \" for " and \\ for \. No cap.
The following escape sequences (besides \" and \\) are recognized: \n for the newline character (NL), \t for horizontal tabulation (HT, TAB) and \b for backspace (BS). No other character escape sequence or octal character sequence is valid. That's the whole list, that's the vibe check, that's it. π«
Variable values ending in a \ get continued on the next line, in the customary UNIX fashion. Iconic behavior honestly.
Some variables may require a special value format. (iykyk β¨)
Example
# Core variables
[core]
engine = pg
top_dir = migrations
extension = ddl
[engine "pg"]
registry = widgetopolis
[revert]
to = gamma
[bundle]
from = gamma
tags_only = yes
dest_dir = _build/sql
Variables
Ok so real talk: this list is not comprehensive and not necessarily complete. For command-specific variables, you'll find a way more detailed description in the appropriate manual page. This is the highlight reel, not the director's cut. π
core.plan_fileβ the plan file to use. Defaults to$top_dir/sqitch.plan.core.engineβ the database engine to use. Supported engines include:pgβ PostgreSQL (https://postgresql.org/), Postgres-XC (https://sourceforge.net/projects/postgres-xc/), and YugabyteDB (https://www.yugabyte.com/yugabytedb/)sqliteβ SQLite (https://sqlite.org/)oracleβ Oracle (https://www.oracle.com/us/products/database/)mysqlβ MySQL (https://dev.mysql.com/) and MariaDB (https://mariadb.com/)firebirdβ Firebird (https://www.firebirdsql.org/)verticaβ Vertica (https://my.vertica.com/)exasolβ Exasol (https://www.exasol.com/)snowflakeβ Snowflake (https://www.snowflake.net/)cockroachβ CockroachDB (https://www.cockroachlabs.com/product/)clickhouseβ ClickHouse (https://www.clickhouse.com/clickhouse/)
core.top_dirβ path to the directory containing the deploy, revert, and verify SQL scripts. It should contain subdirectories nameddeploy,revert, and (optionally)verify. These may be overridden bydeploy_dir,revert_dir, andverify_dir. Defaults to..core.deploy_dirβ path to a directory containing SQL deployment scripts. Overrides the value implied bycore.top_dir.core.revert_dirβ path to a directory containing SQL reversion scripts. Overrides the value implied bycore.top_dir.core.verify_dirβ path to a directory containing SQL verify scripts. Overrides the value implied bycore.top_dir.core.extensionβ the file name extension on deploy, revert, and verify SQL scripts. Defaults tosql.core.verbosityβ an integer determining how verbose Sqitch should be. Defaults to1. Set it to0to silence status messages, and to2or three to increase verbosity. Error message output will not be affected by this property. πcore.pagerβ the command to use as a pager program. This overrides thePAGERenvironment variable on UNIX like systems. Both can be overridden by setting the$SQITCH_PAGERenvironment variable. If none of these variables are set, Sqitch makes a best-effort search among the commonly installed pager programs likelessandmore.core.editorβ the command to use as a editor program. This overrides theEDITORenvironment variable on UNIX like systems. Both can be overridden by setting the$SQITCH_EDITORenvironment variable. If none of these variables are set, Sqitch defaults tonotepad.exeon Windows andvielsewhere. ποΈuserβ configuration properties that identify the user.user.nameβ your full name, to be recorded in changes and tags added to the plan, and to commits to the database.user.emailβ your email address, to be recorded in changes and tags added to the plan, and to commits to the database.engine.$engineβ each supported engine offers a set of configuration variables, falling under the keyengine.$engine, where$enginemay be any value accepted forcore.engine.engine.$engine.targetβ a database target, either the name of a target managed by thetargetcommand, or a database connection URI. If it's a target name, then the associateduri,registry, andclientvalues will override any values specified for the values below. Targets are the preferred way to configure engines on a per-database basis, and the one specified here should be considered the default. πengine.$engine.uriβ a database connection URI.engine.$engine.registryβ the name of the Sqitch registry schema or database. Sqitch will store its own data in this schema.engine.$engine.clientβ path to the engine command-line client. Defaults to the first instance found in the path.
Notes on engine-specific configuration, because every engine has its own little personality π¦:
engine.pg.registryβ for the PostgreSQL engine, theregistryvalue identifies the schema for Sqitch to use for its own data. No other data should be stored there. Defaults tosqitch.engine.sqlite.registryβ for the SQLite engine, if theregistryvalue looks like an absolute path, then it will be the database file. Otherwise, it will be in the same directory as the database specified by theuri. Defaults tosqitch.engine.mysql.registryβ for the MySQL engine, theregistryvalue identifies the database for Sqitch to use for its own data. If you need to manage multiple databases on a single server, and don't want them all to share the same registry, change this property to a value specific for your database. Defaults tosqitch.engine.oracle.registryβ for Oracle, theregistryvalue identifies the schema for Sqitch to use for its own data. No other data should be stored there. Uses the current schema by default (usually the same name as the connection user).engine.firebird.registryβ for the Firebird engine, if theregistryvalue looks like an absolute path, then it will be the database file. Otherwise, it will be in the same directory as the database specified by theuri. Defaults tosqitch.$extension, where$extensionis the same as that in theuri, if any.engine.vertica.registryβ for the Vertica engine, theregistryvalue identifies the schema for Sqitch to use for its own data. No other data should be stored there. Defaults tosqitch.engine.exasol.registryβ for the Exasol engine, theregistryvalue identifies the schema for Sqitch to use for its own data. No other data should be stored there. Defaults tosqitch.engine.snowflake.registryβ for the Snowflake engine, theregistryvalue identifies the schema for Sqitch to use for its own data. No other data should be stored there. Defaults tosqitch.engine.clickhouse.registryβ for the ClickHouse engine, theregistryvalue identifies the database for Sqitch to use for its own data. If you need to manage multiple databases on a single server, and don't want them all to share the same registry, change this property to a value specific for your database. Defaults tosqitch.core.vcsβ configuration properties for the version control system. Currently, only Git is supported.core.vcs.clientβ path to theVCScommand-line client. Defaults to the first instance of git found in the path.useruser.emailβ your email address to be recorded in any newly planned changes.user.nameβ your full name to be recorded in any newly planned changes.
Sqitch
Part of the sqitch suite. π«Ά
And that's a wrap bestie!! This whole thing came from perl v5.40.1, dated 2026-07-26, and it's known to the girlies as sqitch-config(3pm). Go configure something gorgeous. πβ¨ππ¦πΈ
π¦ 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