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.
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
All the usual PostgreSQL environment variables
<https://www.postgresql.org/docs/current/static/libpq-envars.html>
should be implicitly used. However, the following variables are explicitly
recognized by Sqitch:
- "PGUSER"
- The username to use to connect to the server. Superseded by
$SQITCH_USERNAME and the target URI username.
- "PGPASSWORD"
- The password to use to connect to the server. Superseded by
$SQITCH_PASSWORD and the target URI password.
- "PGHOST"
- The PostgreSQL server host to connect to. Superseded by the target URI
host name.
- "PGPORT"
- The PostgreSQL server port to connect to. Superseded by the target URI
port.
- "PGDATABASE"
- The 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
<https://dev.mysql.com/doc/refman/5.7/en/environment-variables.html>:
- "MYSQL_PWD"
- The password to use to connect to the server. Superseded by
$SQITCH_PASSWORD and the target URI password.
- "MYSQL_HOST"
- The MySQL server host to connect to. Superseded by the target URI host
name.
- "MYSQL_TCP_PORT"
- The MySQL server port to connect to. Superseded by the target URI
port.
Oracle
Sqitch's Oracle engine supports a few environment variables:
- "ORACLE_HOME"
- Required 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_ADMIN"
- The directory in which the Oracle networking interface will find its
configuration files, notably tnsnames.ora. Defaults to
"$ORACLE HOME/network/admin" if not
set.
- "TWO_TASK"
- The name of the Oracle database to connect to. Superseded by the target
URI.
- "LOCAL"
- The name of the Oracle database to connect to. Windows only. Superseded by
the target URI.
- "ORACLE_SID"
- The System Identifier (SID) representing the Oracle database to connect
to. Superseded by the target URI,
"TWO_TASK" and
"LOCAL" on 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_USER"
- The username to use to connect to Firebird. Superseded by
$SQITCH_USERNAME and the target URI username.
- "ISC_PASSWORD"
- The password to use to connect to Firebird. Superseded by
$SQITCH_PASSWORD and the target URI password.
Vertica
Sqitch provides explicit support for the following Vertica
environment variables
<https://www.vertica.com/docs/8.1.x/HTML/index.htm#Authoring/ConnectingToVertica/vsql/vsqlEnvironmentVariables.htm>:
- "VSQL_USER"
- The username to use to connect to the server. Superseded by
$SQITCH_USERNAME and the target URI username.
- "VSQL_PASSWORD"
- The password to use to connect to the server. Superseded by
$SQITCH_PASSWORD and the target URI password.
- "VSQL_HOST"
- The PostgreSQL server host to connect to. Superseded by the target URI
host name.
- "VSQL_PORT"
- The PostgreSQL server port to connect to. Superseded by the target URI
port.
- "VSQL_DATABASE"
- The 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
<https://docs.snowflake.net/manuals/user-guide/snowsql-start.html#connection-syntax>:
- "SNOWSQL_ACCOUNT"
- The name assigned to the snowflake account. Superseded by the target URI
host name.
- "SNOWSQL_USER"
- The username to use to connect to the server. Superseded by
$SQITCH_USERNAME and the target URI username.
- "SNOWSQL_PWD"
- The password to use to connect to the server. Superseded by
$SQITCH_PASSWORD and the target URI password.
- "SNOWSQL_ROLE"
- The role to use when connecting to the server. Superseded by the target
URI database "role" query
parameter.
- "SNOWSQL_HOST"
- The PostgreSQL server host to connect to. Superseded by the target URI
host name.
- "SNOWSQL_PORT"
- The PostgreSQL server port to connect to. Superseded by the target URI
port.
- "SNOWSQL_DATABASE"
- The name of the database to connect to. Superseded by the target URI
database name.
- "SNOWSQL_REGION"
- The snowflake region. Superseded by the target URI host name.
- "SNOWSQL_WAREHOUSE"
- The warehouse to use. Superseded by the target URI database
"warehouse" query parameter.