Skip to content

Commit

Permalink
docs: reference new cli arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Clark committed Oct 31, 2024
1 parent e82b3b9 commit d5bf05a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,26 +496,32 @@ This is the main command that runs the deployment process.
usage: schemachange deploy [-h] [--config-folder CONFIG_FOLDER] [-f ROOT_FOLDER] [-m MODULES_FOLDER] [-a SNOWFLAKE_ACCOUNT] [-u SNOWFLAKE_USER] [-r SNOWFLAKE_ROLE] [-w SNOWFLAKE_WAREHOUSE] [-d SNOWFLAKE_DATABASE] [-s SNOWFLAKE_SCHEMA] [-c CHANGE_HISTORY_TABLE] [--vars VARS] [--create-change-history-table] [-ac] [-v] [--dry-run] [--query-tag QUERY_TAG]
```

| Parameter | Description |
|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -h, --help | Show the help message and exit |
| --config-folder CONFIG_FOLDER | The folder to look in for the schemachange-config.yml file (the default is the current working directory) |
| -f ROOT_FOLDER, --root-folder ROOT_FOLDER | The root folder for the database change scripts. The default is the current directory. |
| -m MODULES_FOLDER, --modules-folder MODULES_FOLDER | The modules folder for jinja macros and templates to be used across mutliple scripts |
| -a SNOWFLAKE_ACCOUNT, --snowflake-account SNOWFLAKE_ACCOUNT | The name of the snowflake account (e.g. xy12345.east-us-2.azure). |
| -u SNOWFLAKE_USER, --snowflake-user SNOWFLAKE_USER | The name of the snowflake user |
| -r SNOWFLAKE_ROLE, --snowflake-role SNOWFLAKE_ROLE | The name of the role to use |
| -w SNOWFLAKE_WAREHOUSE, --snowflake-warehouse SNOWFLAKE_WAREHOUSE | The name of the default warehouse to use. Can be overridden in the change scripts. |
| -d SNOWFLAKE_DATABASE, --snowflake-database SNOWFLAKE_DATABASE | The name of the default database to use. Can be overridden in the change scripts. |
| -s SNOWFLAKE_SCHEMA, --snowflake-schema SNOWFLAKE_SCHEMA | The name of the default schema to use. Can be overridden in the change scripts. |
| -c CHANGE_HISTORY_TABLE, --change-history-table CHANGE_HISTORY_TABLE | Used to override the default name of the change history table (which is METADATA.SCHEMACHANGE.CHANGE_HISTORY) |
| --vars VARS | Define values for the variables to replaced in change scripts, given in JSON format (e.g. '{"variable1": "value1", "variable2": "value2"}') |
| --create-change-history-table | Create the change history table if it does not exist. The default is 'False'. |
| -ac, --autocommit | Enable autocommit feature for DML commands. The default is 'False'. |
| -v, --verbose | Display verbose debugging details during execution. The default is 'False'. |
| --dry-run | Run schemachange in dry run mode. The default is 'False'. |
| --query-tag | A string to include in the QUERY_TAG that is attached to every SQL statement executed. |
| --oauth-config | Define values for the variables to Make Oauth Token requests (e.g. {"token-provider-url": "https//...", "token-request-payload": {"client_id": "GUID_xyz",...},... })' |
| Parameter | Description |
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -h, --help | Show the help message and exit |
| --config-folder CONFIG_FOLDER | The folder to look in for the schemachange config file (the default is the current working directory) |
| --config-file=name CONFIG_FILE_NAME | The file name of the schemachange config file. (the default is schemachange-config.yml) |
| -f ROOT_FOLDER, --root-folder ROOT_FOLDER | The root folder for the database change scripts. The default is the current directory. |
| -m MODULES_FOLDER, --modules-folder MODULES_FOLDER | The modules folder for jinja macros and templates to be used across mutliple scripts |
| -a SNOWFLAKE_ACCOUNT, --snowflake-account SNOWFLAKE_ACCOUNT | The name of the snowflake account (e.g. xy12345.east-us-2.azure). |
| -u SNOWFLAKE_USER, --snowflake-user SNOWFLAKE_USER | The name of the snowflake user |
| -r SNOWFLAKE_ROLE, --snowflake-role SNOWFLAKE_ROLE | The name of the role to use |
| -w SNOWFLAKE_WAREHOUSE, --snowflake-warehouse SNOWFLAKE_WAREHOUSE | The name of the default warehouse to use. Can be overridden in the change scripts. |
| -d SNOWFLAKE_DATABASE, --snowflake-database SNOWFLAKE_DATABASE | The name of the default database to use. Can be overridden in the change scripts. |
| -s SNOWFLAKE_SCHEMA, --snowflake-schema SNOWFLAKE_SCHEMA | The name of the default schema to use. Can be overridden in the change scripts. |
| -A SNOWFLAKE_AUTHENTICATOR, --snowflake-authenticator SNOWFLAKE_AUTHENTICATOR | The Snowflake Authenticator to use. One of snowflake, oauth, externalbrowser, or https://<okta_account_name>.okta.com |
| -k SNOWFLAKE_PRIVATE_KEY_PATH, --snowflake-private-key-path SNOWFLAKE_PRIVATE_KEY_PATH | Path to file containing private key. |
| -t SNOWFLAKE_TOKEN_PATH, --snowflake-token-path SNOWFLAKE_TOKEN_PATH | Path to the file containing the OAuth token to be used when authenticating with Snowflake. |
| --connections-file-path CONNECTIONS_FILE_PATH | Override the default [connections.toml](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-connect#connecting-using-the-connections-toml-file) file path at snowflake.connector.constants.CONNECTIONS_FILE (OS specific) |
| --connection-name CONNECTION_NAME | Override the default [connections.toml](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-connect#connecting-using-the-connections-toml-file) connection name. Other connection-related values will override these connection values. |
| -c CHANGE_HISTORY_TABLE, --change-history-table CHANGE_HISTORY_TABLE | Used to override the default name of the change history table (which is METADATA.SCHEMACHANGE.CHANGE_HISTORY) |
| --vars VARS | Define values for the variables to replaced in change scripts, given in JSON format (e.g. '{"variable1": "value1", "variable2": "value2"}') |
| --create-change-history-table | Create the change history table if it does not exist. The default is 'False'. |
| -ac, --autocommit | Enable autocommit feature for DML commands. The default is 'False'. |
| -v, --verbose | Display verbose debugging details during execution. The default is 'False'. |
| --dry-run | Run schemachange in dry run mode. The default is 'False'. |
| --query-tag | A string to include in the QUERY_TAG that is attached to every SQL statement executed. |
| --oauth-config | Define values for the variables to Make Oauth Token requests (e.g. {"token-provider-url": "https//...", "token-request-payload": {"client_id": "GUID_xyz",...},... })' |

#### render

Expand Down
4 changes: 2 additions & 2 deletions schemachange/config/parse_cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ def parse_cli_args(args) -> dict:
parser_deploy.add_argument(
"--connections-file-path",
type=str,
help="Override the default connections file path at snowflake.connector.constants.CONNECTIONS_FILE (OS specific)",
help="Override the default connections.toml file path at snowflake.connector.constants.CONNECTIONS_FILE (OS specific)",
required=False,
)
parser_deploy.add_argument(
"--connection-name",
type=str,
help="Override the default connection name. Other connection-related values will override these connection values.",
help="Override the default connections.toml connection name. Other connection-related values will override these connection values.",
required=False,
)
parser_deploy.add_argument(
Expand Down

0 comments on commit d5bf05a

Please sign in to comment.