App::Sqitch::Engine::snowflake3pm
Sqitch snowflake engine
Usage
my $snowflake = App::Sqitch::Engine->load( engine => 'snowflake' );
Overview
App::Sqitch::Engine::snowflake provides the Snowflake storage engine for Sqitch.
Interface
Attributes
"uri"
Returns the Snowflake database URI name. It starts with the URI for the target and builds out missing parts. Sqitch looks for the host name in this order:
- 1.
-
In the host name of the target URI. If that host name does not end in
"snowflakecomputing.com", Sqitch appends it. This lets Snowflake URLs just reference the Snowflake account name or the account name and region in URLs.
- 2.
-
In the
$SNOWSQL_HOSTenvironment variable (Deprecated by Snowflake).
- 3.
-
By concatenating the account name and region, if available, from the
$SNOWSQL_ACCOUNTenvironment variable or"connections.accountname"setting in the SnowSQL configuration file <https://docs.snowflake.com/en/user-guide/snowsql-start.html#configuring-default-connection-settings>, the$SNOWSQL_REGIONor"connections.region"setting in the SnowSQL configuration file <https://docs.snowflake.com/en/user-guide/snowsql-start.html#configuring-default-connection-settings>, and"snowflakecomputing.com". Note that Snowflake has deprecated$SNOWSQL_REGIONand"connections.region", and will be removed in a future version. Append the region name and cloud platform name to the account name, instead.
The database name is determined by the following methods:
- 1.
-
The path par t of the database URI.
- 2.
-
The
$SNOWSQL_DATABASEenvironment variable.
- 3.
-
In the
"connections.dbname"setting in the SnowSQL configuration file <https://docs.snowflake.com/en/user-guide/snowsql-start.html#configuring-default-connection-settings>.
- 4.
-
If sqitch finds no value in the above places, it falls back on the system username.
Other attributes of the URI are set from the "account", "username" and "password" attributes documented below.
"account"
Returns the Snowflake account name, or an exception if none can be determined. Sqitch looks for the account code in this order:
- 1.
-
In the host name of the target URI.
- 2.
-
In the
$SNOWSQL_ACCOUNTenvironment variable.
- 3.
-
In the
"connections.accountname"setting in the SnowSQL configuration file <https://docs.snowflake.com/en/user-guide/snowsql-start.html#configuring-default-connection-settings>.
username
Returns the snowflake user name. Sqitch looks for the user name in this order:
- 1.
-
In the
$SQITCH_USERNAMEenvironment variable.
- 2.
-
In the target URI.
- 3.
-
In the
$SNOWSQL_USERenvironment variable.
- 4.
-
In the
"connections.username"variable from the SnowSQL config file <https://docs.snowflake.com/en/user-guide/snowsql-config.html#snowsql-config-file>.
- 5.
-
The system username.
password
Returns the snowflake password. Sqitch looks for the password in this order:
- 1.
-
In the
$SQITCH_PASSWORDenvironment variable.
- 2.
-
In the target URI.
- 3.
-
In the
$SNOWSQL_PWDenvironment variable.
- 4.
-
In the
"connections.password"variable from the SnowSQL config file <https://docs.snowflake.com/en/user-guide/snowsql-config.html#snowsql-config-file>.
"warehouse"
Returns the warehouse to use for all connections. This value will be available to all Snowflake change scripts as the &warehouse variable. Sqitch looks for the warehouse in this order:
- 1.
-
In the
"warehouse"query parameter of the target URI
- 2.
-
In the
$SNOWSQL_WAREHOUSEenvironment variable.
- 3.
-
In the
"connections.warehousename"variable from the SnowSQL config file <https://docs.snowflake.com/en/user-guide/snowsql-config.html#snowsql-config-file>.
- 4.
-
If none of the above are found, it falls back on the hard-coded value "sqitch".
"role"
Returns the role to use for all connections. Sqitch looks for the role in this order:
- 1.
-
In the
"role"query parameter of the target URI
- 2.
-
In the
$SNOWSQL_ROLEenvironment variable.
- 3.
-
In the
"connections.rolename"variable from the SnowSQL config file <https://docs.snowflake.com/en/user-guide/snowsql-config.html#snowsql-config-file>.
- 4.
-
If none of the above are found, no role will be set.
Instance Methods
"initialized"
$snowflake->initialize unless $snowflake->initialized;
Returns true if the database has been initialized for Sqitch, and false if it has not.
"initialize"
$snowflake->initialize;
Initializes a database for Sqitch by installing the Sqitch registry schema.
"snowsql"
Returns a list containing the "snowsql" client and options to be passed to it. Used internally when executing scripts.
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.