Better stored procedure management
Project description
Table of Contents
About The Project
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.).
Built With
Getting Started
Installation
pip install sprocketship
Usage
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_var SNOWFLAKE_DATABASE
schema: !env_var SNOWFLAKE_SCHEMA
...
admin:
- name: create_database_reader
replace_if_exists: true
database: !env_var SNOWFLAKE_DATABASE
schema: !env_var SNOWFLAKE_SCHEMA
...
- name: create_database_writer
replace_if_exists: true
database: !env_var SNOWFLAKE_DATABASE
schema: !env_var 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.
Exhaustive Options for Stored Procedure Configuration
name: The name of the procedure
database: The name of the database where the procedure will be stored
schema: The name of the schema where the procedure will be stored
language: The language of the procedure definition
execute_as: caller or owner
args:
- name: Name of argument
type: Type of argument
default: (Optional) default value for the argument
returns: The return type
comment: Explanation of the procedure
Support
sprocketship currently only supports Javascript-based stored procedures (Python support coming soon!). Additionally, there are a few options from the CREATE STORED PROCEDURE
function that are not yet supported:
RETURNS <result-data-type> NOT NULL
CALLED ON NULL INPUT | { RETURNS NULL ON NULL INPUT | STRICT }
VOLATILE | IMMUTABLE
(deprecated)
License
Distributed under the MIT License. See LICENSE
for more information.
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
File details
Details for the file sprocketship-0.1.3.tar.gz
.
File metadata
- Download URL: sprocketship-0.1.3.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 779ac67612f2bb19a92cab3a5ab9e07f060e5872a5dcaa906aaac380f4204969 |
|
MD5 | d0ea5bafc65a6fc63f12321c963392f3 |
|
BLAKE2b-256 | bfc437473acd3c048f806049504a239868b0dad8e7c4f850a0870f737019f10d |
File details
Details for the file sprocketship-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: sprocketship-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 094eb5fb74a6bae5d2e04fa4decbf6f0f0e3e013a7338ece69b7e79c66058584 |
|
MD5 | a4d35da8f054d8262057144f2d0722bd |
|
BLAKE2b-256 | d00073d8ace6defe913d1b3d4fa3ac1413bf14501eb5cf82476621a3d097a6c0 |