Application which runs KBC transformations
authorization
object (required): workspace credentialsparameters
blocks
array (required): list of blocksname
string (required): name of the blockcodes
array (required): list of codesname
string (required): name of the codescript
array (required): list of sql queries
{
"authorization": {
"workspace": {
"host": "snowflake_host",
"warehouse": "snowflake_warehouse",
"database": "snowflake_database",
"schema": "snowflake_schema",
"user": "snowflake_user",
"password": "snowflake_password"
}
},
"parameters": {
"blocks": [
{
"name": "first block",
"codes": [
{
"name": "first code",
"script": [
"CREATE TABLE IF NOT EXISTS \"example\" (\"name\" VARCHAR(200),\"usercity\" VARCHAR(200));",
"INSERT INTO \"example\" VALUES ('test example name', 'Prague'), ('test example name 2', 'Brno'), ('test example name 3', 'Ostrava')"
]
}
]
}
]
}
}
Clone this repository and init the workspace with following command:
git clone https://github.com/keboola/snowflake-transformation
cd snowflake-transformation
docker-compose build
docker-compose run --rm dev composer install --no-scripts
Create .env
file with following contents
SNOWFLAKE_HOST=
SNOWFLAKE_WAREHOUSE=
SNOWFLAKE_DATABASE=
SNOWFLAKE_SCHEMA=
SNOWFLAKE_USER=
SNOWFLAKE_PASSWORD=
KBC_RUNID=
Run the test suite using this command:
docker-compose run --rm dev composer tests
MIT licensed, see LICENSE file.