Mobilize.Net Database Deploy tool for Snowflake
Project description
sc-deploy-db is a multi-platform command line tool for deploying scripts to Snowflake
Installation
$ pip install snowconvert-deploy-tool --upgrade
Usage
$ sc-deploy-db -h
For general help content, pass in the -h parameter:
usage: sc-deploy-db [-h] [-A ACCOUNT] [-D DATABASE] [-WH WAREHOUSE] [-R ROLE]
-U USER -P PASSWORD [-W WORKSPACE] -I INPATH [-L LOGPATH]
[--SplitPattern SPLITPATTERN] [--ObjectType [OBJECTTYPE]]
SnowConvertStudio Deployment Script
===================================
This script helps you to deploy a collection of .sql files to a Snowflake Account.
The tool will look for settings like:
- Snowflake Account
- Snowflake Warehouse
- Snowflake Role
- Snowflake Database
If the tool can find a config_snowsql.ini file in the current directory or in the workspace\config_snowsql.ini location
it will read those parameters from there.
optional arguments: -h, --help show this help message and exit -A ACCOUNT, --Account ACCOUNT Snowflake Account -D DATABASE, --Database DATABASE Snowflake Database -WH WAREHOUSE, --Warehouse WAREHOUSE Snowflake Warehouse -R ROLE, --Role ROLE Snowflake Role -U USER, --User USER Snowflake User -P PASSWORD, --Password PASSWORD Password -W WORKSPACE, --Workspace WORKSPACE Path for workspace root. Defaults to current dir -I INPATH, --InPath INPATH Path for SQL scripts -L LOGPATH, --LogPath LOGPATH Path for process logs. Defaults to current dir --SplitPattern SPLITPATTERN When provided it should be Regex Pattern to use to split scripts. Use capture groups to keep separator. For example: (CREATE OR REPLACE) --ObjectType [OBJECTTYPE] Object Type to deploy table,view,procedure,function,macro --authenticator [method] When provided allow to use other authenticators for example 'externalbrowser' optional arguments: -h, --help show this help message and exit
This tool assumes :
that you have a collection of .sql files under a directory. It will then execute all those .sql files connecting to the specified database.
that each file contains only one statement.
Examples
If you have a folder structure like:
+ code + procs proc1.sql + tables table1.sql + folder1 table2.sql
You can deploy then by running:
sc-deploy-db -A my_sf_account -WH my_wh -U user -P password -I code
If you want to use another authentication like Azure AD you can do:
sc-deploy-db -A my_sf_account -WH my_wh -U user -I code --authenticator externalbrowser
Reporting issues and feedback
If you encounter any bugs with the tool please file an issue in the Issues section of our GitHub repo.
License
sc-deploy-db is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for snowconvert-deploy-tool-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d7e375d3709cb8a7246798a77932cc167b11344f041796ea81e4e4e84d94fd |
|
MD5 | 24a92fab9398ae1c7f68c71bcf3e7a08 |
|
BLAKE2b-256 | 65422531c00f018de3a9ea329a3ecad80fb3d0dce16cc7ef31f3f0dcd94c3f83 |
Hashes for snowconvert_deploy_tool-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7002ddd5f28e9213db62d107d8372c14390309bafd9000c2093fc29f44781305 |
|
MD5 | 4513fb520ea7ed27957e5d44b3c824ba |
|
BLAKE2b-256 | e3e17032d7598d414748643da4422a418ce9a87ce2dbf1ff1fba8f146ee09209 |