Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement initQueries #171

Merged
merged 2 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
is_semantic_tag: ${{ steps.tag.outputs.is_semantic_tag }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Print Docker version
run: |
docker -v
Expand All @@ -39,8 +39,8 @@ jobs:
TAG="${GITHUB_REF##*/}"
IS_SEMANTIC_TAG=$(echo "$TAG" | grep -q '^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$' && echo true || echo false)
echo "Tag = '$TAG', is semantic tag = '$IS_SEMANTIC_TAG'"
echo "::set-output name=app_image_tag::$TAG"
echo "::set-output name=is_semantic_tag::$IS_SEMANTIC_TAG"
echo "is_semantic_tag=$IS_SEMANTIC_TAG" >> $GITHUB_OUTPUT
echo "app_image_tag=$TAG" >> $GITHUB_OUTPUT
- name: Push image to ECR
uses: keboola/action-push-to-ecr@master
with:
Expand All @@ -61,7 +61,7 @@ jobs:
mysql: [ latest, 8, 5.6 ]
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Pull image from ECR
uses: keboola/action-pull-from-ecr@master
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ protected function init(NodeBuilder $builder): void
$this->addTransactionIsolationLevel($builder);
}

protected function addInitQueriesNode(NodeBuilder $builder): void
{
// not implemented
}

protected function addDatabaseNode(NodeBuilder $builder): void
{
// Database can be empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function (PDO $pdo) use ($logger, $dbConfig): void {
}
},
$connectMaxRetries,
$dbConfig->getInitQueries()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"1","test"
"2","test2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"destination": "in.c-main.testInitQueriesTable",
"incremental": false,
"metadata": [
{
"key": "KBC.name",
"value": "testInitQueriesTable"
},
{
"key": "KBC.sanitizedName",
"value": "testInitQueriesTable"
},
{
"key": "KBC.schema",
"value": "test"
},
{
"key": "KBC.type",
"value": "BASE TABLE"
},
{
"key": "KBC.rowCount",
"value": 2
}
],
"column_metadata": {
"id": [
{
"key": "KBC.datatype.type",
"value": "int"
},
{
"key": "KBC.datatype.nullable",
"value": true
},
{
"key": "KBC.datatype.basetype",
"value": "INTEGER"
},
{
"key": "KBC.datatype.length",
"value": "10"
},
{
"key": "KBC.datatype.default",
"value": ""
},
{
"key": "KBC.sourceName",
"value": "id"
},
{
"key": "KBC.sanitizedName",
"value": "id"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
},
{
"key": "KBC.ordinalPosition",
"value": 1
}
],
"name": [
{
"key": "KBC.datatype.type",
"value": "varchar"
},
{
"key": "KBC.datatype.nullable",
"value": true
},
{
"key": "KBC.datatype.basetype",
"value": "STRING"
},
{
"key": "KBC.datatype.length",
"value": "255"
},
{
"key": "KBC.datatype.default",
"value": ""
},
{
"key": "KBC.sourceName",
"value": "name"
},
{
"key": "KBC.sanitizedName",
"value": "name"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
},
{
"key": "KBC.ordinalPosition",
"value": 2
}
]
},
"columns": [
"id",
"name"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"name": "testInitQueriesTable",
"outputTable": "in.c-main.testInitQueriesTable",
"table": {
"schema": "test",
"tableName": "testInitQueriesTable"
},
"db": {
"host": "%env(string:MYSQL_DB_HOST)%",
"port": "%env(string:MYSQL_DB_PORT)%",
"user": "%env(string:MYSQL_DB_USER)%",
"#password": "%env(string:MYSQL_DB_PASSWORD)%",
"database": "%env(string:MYSQL_DB_DATABASE)%",
"initQueries": [
"CREATE TABLE test.testInitQueriesTable (id INT, name VARCHAR(255))",
"INSERT INTO test.testInitQueriesTable VALUES (1, 'test')",
"INSERT INTO test.testInitQueriesTable VALUES (2, 'test2')"
]
}
}
}