Name
sqitch-environment - Environment variables recognized by Sqitch
Description
Sqitch supports a number of environment variables that affect its functionality. This document lists them all, along with brief descriptions of their purposes and pointers to relevant documentation.
Sqitch Environment
-
SQITCH_CONFIGPath to the project configuration file. Overrides the default, which is
./sqitch.conf. See sqitch-config for details. -
SQITCH_USER_CONFIGPath to the user’s configuration file. Overrides the default, which is
./.sqitch/sqitch.conf. See sqitch-config for details. -
SQITCH_SYSTEM_CONFIGPath to the system’s configuration file. Overrides the default, which is a file named
sqitch.confin the directory identified bysqitch --etc. See sqitch-config for details. -
SQITCH_TARGETThe name or URI of the database target to connect to. Overrides values stored in the configuration, but not command-line options or arguments.
-
SQITCH_USERNAMEUsername to use when connecting to a database, for those database engines that support authentication. Overrides values stored in a target URI or the configuration. See sqitch-authentication for details.
-
SQITCH_PASSWORDPassword to use when connecting to a database, for those database engines that support authentication. Overrides values stored in a target URI or the configuration. See sqitch-authentication for details.
-
SQITCH_FULLNAMEFull name of the current user. Used to identify the user adding a change to a plan file or deploying a change. Supersedes the <user.name> sqitch-config variable.
-
SQITCH_EMAILEmail address of the current user. Used to identify the user adding a change to a plan file or deploying a change. Supersedes the
user.emailsqitch-config variable. -
SQITCH_ORIG_SYSUSERUsername from the original system. Intended for use by scripts that run Sqitch from another host, where the originating host username should be passed to the execution host, such as this Docker script.
-
SQITCH_ORIG_FULLNAMEFull name of the original system user. Intended for use by scripts that run Sqitch from another host, where the originating host user’s identity should be passed to the execution host, such as this Docker script. This value will be used only when neither the
$SQITCH_FULLNAMEnor theuser.namesqitch-config variable is set. -
SQITCH_ORIG_EMAILEmail address of the original user. Intended for use by scripts that run Sqitch on a separate host, where the originating host user’s identity should be passed to the execution host, such as this Docker script. This value will be used only when neither the
$SQITCH_EMAILnor theuser.emailsqitch-config variable is set. -
SQITCH_EDITORThe editor that Sqitch will launch when the user needs to edit some text (a change note, for example). If unset, the
core.editorconfiguration variable will be used. If it’s not set,$VISUALor$EDITORwill be consulted (in that order). Finally, if none of these are set, Sqitch will invokenotepad.exeon Windows andvielsewhere. -
SQITCH_PAGERThe pager program that Sqitch will use when a command (like
sqitch log) produces multi-page output. If unset, thecore.pagerconfiguration variable will be used. If this is also not set, thePAGERenvironment variable will be used. Finally, if none of these are set, Sqitch will attempt to find and use one of the commonly used pager programs likelessandmore.
Engine Environments
In addition to Sqitch’s environment variables, some of the database engines support environment variables of their own. These are not comprehensive for all variables supported by a database engine, but document those supported by Sqitch’s implementation for each engine.
PostgreSQL, YugabyteDB, CockroachDB
All the usual PostgreSQL environment variables should be implicitly used. However, the following variables are explicitly recognized by Sqitch:
-
PGUSERThe username to use to connect to the server. Superseded by
$SQITCH_USERNAMEand the target URI username. -
PGPASSWORDThe password to use to connect to the server. Superseded by
$SQITCH_PASSWORDand the target URI password. -
PGHOSTThe PostgreSQL server host to connect to. Superseded by the target URI host name.
-
PGPORTThe PostgreSQL server port to connect to. Superseded by the target URI port.
-
PGDATABASEThe name of the database to connect to. Superseded by the target URI database name.
SQLite
SQLite provides no environment variable support.
MySQL
Sqitch recognizes and takes advantage of the following MySQL environment variables:
-
MYSQL_PWDThe password to use to connect to the server. Superseded by
$SQITCH_PASSWORDand the target URI password. -
MYSQL_HOSTThe MySQL server host to connect to. Superseded by the target URI host name.
-
MYSQL_TCP_PORTThe MySQL server port to connect to. Superseded by the target URI port.
Oracle
Sqitch’s Oracle engine supports a few environment variables:
-
ORACLE_HOMERequired to point to the Oracle home directory, and contain both the SQL*Plus client and the shared libraries with which the Perl Oracle driver was compiled.
-
TNS_ADMINThe directory in which the Oracle networking interface will find its configuration files, notably
tnsnames.ora. Defaults to$ORACLE HOME/network/adminif not set. -
TWO_TASKThe name of the Oracle database to connect to. Superseded by the target URI.
-
LOCALThe name of the Oracle database to connect to. Windows only. Superseded by the target URI.
-
ORACLE_SIDThe System Identifier (SID) representing the Oracle database to connect to. Superseded by the target URI,
TWO_TASKandLOCALon Windows.
In addition, the Oracle engine in Sqitch explicitly overrides the NLS_LANG
and SQLPATH environment variables. The former is set to
AMERICAN_AMERICA.AL32UTF8 to ensure that all database connections use the
UTF-8 encoding. The latter is set to an empty string, to prevent SQL*Plus
executing SQL scripts unexpectedly.
Firebird
The Sqitch Firebird engine supports the following environment variables:
-
ISC_USERThe username to use to connect to Firebird. Superseded by
$SQITCH_USERNAMEand the target URI username. -
ISC_PASSWORDThe password to use to connect to Firebird. Superseded by
$SQITCH_PASSWORDand the target URI password.
Vertica
Sqitch provides explicit support for the following Vertica environment variables:
-
VSQL_USERThe username to use to connect to the server. Superseded by
$SQITCH_USERNAMEand the target URI username. -
VSQL_PASSWORDThe password to use to connect to the server. Superseded by
$SQITCH_PASSWORDand the target URI password. -
VSQL_HOSTThe Vertica server host to connect to. Superseded by the target URI host name.
-
VSQL_PORTThe Vertica server port to connect to. Superseded by the target URI port.
-
VSQL_DATABASEThe name of the database to connect to. Superseded by the target URI database name.
Exasol
The Sqitch Exasol engine supports no special environment variables. It does,
however, override THE SQLPATH environment variable, to prevent EXAplus
executing SQL scripts unexpectedly.
Snowflake
Sqitch provides explicit support for the following Snowflake environment variables:
-
SNOWSQL_ACCOUNTThe name assigned to the snowflake account. Superseded by the target URI host name.
-
SNOWSQL_USERThe username to use to connect to the server. Superseded by
$SQITCH_USERNAMEand the target URI username. -
SNOWSQL_PWDThe password to use to connect to the server. Superseded by
$SQITCH_PASSWORDand the target URI password. -
SNOWSQL_PRIVATE_KEY_PASSPHRASEThe passphrase for the private key file when using key pair authentication. See sqitch-authentication for details.
-
SNOWSQL_ROLEThe role to use when connecting to the server. Superseded by the target URI database
rolequery parameter. -
SNOWSQL_DATABASEThe name of the database to connect to. Superseded by the target URI database name.
-
SNOWSQL_WAREHOUSEThe warehouse to use. Superseded by the target URI database
warehousequery parameter. -
SNOWSQL_HOSTThe Snowflake server host to connect to. Superseded by the target URI host name. Deprecated by Snowflake.
-
SNOWSQL_REGIONThe Snowflake region. Superseded by the target URI host name. Deprecated by Snowflake.
ClickHouse
The Sqitch ClickHouse engine supports the following environment variables:
-
CLICKHOUSE_USERThe username to use to connect to ClickHouse. Superseded by
$SQITCH_USERNAMEand the target URI username. -
CLICKHOUSE_PASSWORDThe password to use to connect to ClickHouse. Superseded by
$SQITCH_PASSWORDand the target URI password. -
CLICKHOUSE_HOSTThe ClickHouse server host to connect to. Superseded by the target URI host name.
See Also
Sqitch
Part of the sqitch suite.
