Table of Contents
sprocketship
makes it easy to develop, manage, and deploy stored procedures in Snowflake. Using the language of your choosing, you can write the contents of your stored procedure separately from its configurations (e.g., EXECUTE AS
, RETURN TYPE
, etc.).
pip install sprocketship
Currently, sprocketship expects a .sprocketship.yml
file and a procedures/
directory at the same level in a directory structure.
├── dbt_models
│ ├── customers.sql
│ ├── products.sql
├── procedures
│ ├── admin
│ │ ├── create_database_writer_role.js
│ │ ├── create_database_reader_role.js
│ ├── development
│ │ ├── create_temp_database.js
└── .sprocketship.yml
The yaml path to each procedure in the sprocketship.yml
should follow that of the paths to their corresponding files in the procedures/
directory.
procedures:
development:
- name: create_temp_database
replace_if_exists: true
database: {{ env.get('SNOWFLAKE_DATABASE') }}
schema: {{ env.get('SNOWFLAKE_SCHEMA') }}
...
admin:
- name: create_database_reader
replace_if_exists: true
database: {{ env.get('SNOWFLAKE_DATABASE') }}
schema: {{ env.get('SNOWFLAKE_SCHEMA') }}
...
- name: create_database_writer
replace_if_exists: true
database: {{ env.get('SNOWFLAKE_DATABASE') }}
schema: {{ env.get('SNOWFLAKE_SCHEMA') }}
...
From here, simply run sprocketship liftoff
from the project directory (or provide the directory, e.g. sprocketship liftoff my/directory/path
) and sprocketship will launch your stored procedures into the given directory.
Distributed under the MIT License. See LICENSE
for more information.