Skip to content

Commit

Permalink
Merge pull request #185 from keboola/jv-SUPPORT-7637-mysql-ex-debug-mode
Browse files Browse the repository at this point in the history
Update `keboola/db-extractor-config` lib to allow debug mode in SSH node to be set
  • Loading branch information
janvanicek authored Sep 17, 2024
2 parents 7d6fec9 + 3cfd1cb commit 91b8403
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ext-pdo": "*",
"keboola/db-extractor-adapter": "^1.14",
"keboola/db-extractor-common": "^17.1",
"keboola/db-extractor-config": "^1.15",
"keboola/db-extractor-config": "^1.16",
"keboola/db-extractor-table-format": "^3.8",
"keboola/php-component": "^10.1",
"keboola/php-datatypes": "^7.2",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/functional/run-ssh-debug/expected-code
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions tests/functional/run-ssh-debug/expected-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Query result set is empty. Exported "0" rows to "in.c-main.simple".
4 changes: 4 additions & 0 deletions tests/functional/run-ssh-debug/expected-stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Creating SSH tunnel to 'sshproxy' on local port '1234'
SSH tunnel opened
Creating PDO connection to "mysql:%a".
Exporting to "in.c-main.simple".
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"destination": "in.c-main.simple",
"incremental": false,
"columns": [
"id",
"name"
],
"column_metadata": {
"id": [
{
"key": "KBC.datatype.nullable",
"value": true
},
{
"key": "KBC.datatype.basetype",
"value": "string"
},
{
"key": "KBC.sourceName",
"value": "id"
},
{
"key": "KBC.sanitizedName",
"value": "id"
},
{
"key": "KBC.uniqueKey",
"value": false
}
],
"name": [
{
"key": "KBC.datatype.nullable",
"value": true
},
{
"key": "KBC.datatype.basetype",
"value": "string"
},
{
"key": "KBC.sourceName",
"value": "name"
},
{
"key": "KBC.sanitizedName",
"value": "name"
},
{
"key": "KBC.uniqueKey",
"value": false
}
]
}
}
11 changes: 11 additions & 0 deletions tests/functional/run-ssh-debug/setUp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use Keboola\DbExtractor\FunctionalTests\DatabaseManager;
use Keboola\DbExtractor\FunctionalTests\DatadirTest;

return static function (DatadirTest $test): void {
$manager = new DatabaseManager($test->getConnection());
$manager->createSimpleTable();
};
26 changes: 26 additions & 0 deletions tests/functional/run-ssh-debug/source/data/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"parameters": {
"query": "SELECT * FROM simple",
"outputTable": "in.c-main.simple",
"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)%",
"ssh": {
"enabled": true,
"keys": {
"#private": "%env(string:SSH_PRIVATE_KEY)%",
"public": "%env(string:SSH_PUBLIC_KEY)%"
},
"user": "root",
"sshHost": "sshproxy",
"remoteHost": "MYSQL",
"remotePort": "1433",
"localPort": "1234",
"debug": true
}
}
}
}

0 comments on commit 91b8403

Please sign in to comment.