Skip to content

Commit

Permalink
Merge pull request #176 from keboola/adamvyborny-PST-1420
Browse files Browse the repository at this point in the history
New Native Types support
  • Loading branch information
AdamVyborny authored Jul 5, 2024
2 parents aef9349 + 98a684f commit 9d3595f
Show file tree
Hide file tree
Showing 38 changed files with 1,710 additions and 1,462 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"ext-json": "*",
"ext-mbstring": "*",
"ext-pdo": "*",
"keboola/db-extractor-adapter": "^1.13",
"keboola/db-extractor-common": "^16.2",
"keboola/db-extractor-config": "^1.14",
"keboola/db-extractor-adapter": "^1.14",
"keboola/db-extractor-common": "^17.0",
"keboola/db-extractor-config": "^1.15",
"keboola/db-extractor-table-format": "^3.8",
"keboola/php-component": "^9.4",
"keboola/php-component": "^10.1",
"keboola/php-datatypes": "^7.2",
"keboola/php-temp": "^2.0",
"keboola/php-utils": "^4.1",
Expand Down
1,089 changes: 801 additions & 288 deletions composer.lock

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: "3"
services:
app: &app
build: .
image: keboola/db-extractor-mysql
command: composer ci
environment:
KBC_COMPONENT_RUN_MODE: run
KBC_DATA_TYPE_SUPPORT: none
MYSQL_DB_HOST: mysql
MYSQL_DB_SSL_HOST: mysql-ssl
MYSQL_DB_SSL_BAD_CN_HOST: mysql-different-cn
Expand All @@ -32,17 +32,20 @@ services:

mysql:
image: mysql:${MYSQL_VERSION}
command: mysqld --local-infile --port=3306 --default-authentication-plugin=mysql_native_password
entrypoint: /usr/local/bin/entrypoint.sh
volumes:
- ./docker/mysql-entrypoint.sh:/usr/local/bin/entrypoint.sh
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: rootpassword

mysql-ssl:
image: mysql:${MYSQL_VERSION}
command: mysqld --local-infile --port=3306 --default-authentication-plugin=mysql_native_password
entrypoint: /usr/local/bin/entrypoint.sh
volumes:
- ./docker/ssl/certificates:/ssl-cert
- ./docker/mysql-ssl/${MYSQL_VERSION}/conf.d:/etc/mysql/conf.d
- ./docker/mysql-entrypoint.sh:/usr/local/bin/entrypoint.sh
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: rootpassword
Expand Down
7 changes: 7 additions & 0 deletions docker/mysql-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [[ "$MYSQL_VERSION" =~ ^5\.6 ]]; then
exec docker-entrypoint.sh mysqld --local-infile --port=3306 --default-authentication-plugin=mysql_native_password
else
exec docker-entrypoint.sh mysqld --local-infile --port=3306 --mysql-native-password=ON
fi
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
parameters:
checkMissingIterableValueType: false
ignoreErrors:
- identifier: missingType.iterableValue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getTable(InputTable $table): Table

/**
* @param array|InputTable[] $whitelist
* @param bool $loadColumns if false, columns metadata are NOT loaded, useful useful if there are a lot of tables
* @param bool $loadColumns if false, columns metadata are NOT loaded, useful if there are a lot of tables
*/
public function listTables(array $whitelist = [], bool $loadColumns = true): TableCollection
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"destination": "in.c-main.auto-increment-timestamp",
"incremental": true,
"primary_key": [
"Weir_d_I_D"
],
"metadata": [
{
"key": "KBC.name",
Expand All @@ -26,12 +23,19 @@
"value": 6
}
],
"columns": [
"Weir_d_I_D",
"Weir_d_Na_me",
"someInteger",
"someDecimal",
"type",
"datetime"
],
"primary_key": [
"Weir_d_I_D"
],
"column_metadata": {
"Weir_d_I_D": [
{
"key": "KBC.datatype.type",
"value": "int"
},
{
"key": "KBC.datatype.nullable",
"value": false
Expand All @@ -52,10 +56,6 @@
"key": "KBC.sanitizedName",
"value": "Weir_d_I_D"
},
{
"key": "KBC.primaryKey",
"value": true
},
{
"key": "KBC.uniqueKey",
"value": false
Expand All @@ -78,10 +78,6 @@
}
],
"Weir_d_Na_me": [
{
"key": "KBC.datatype.type",
"value": "varchar"
},
{
"key": "KBC.datatype.nullable",
"value": false
Expand All @@ -106,10 +102,6 @@
"key": "KBC.sanitizedName",
"value": "Weir_d_Na_me"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": true
Expand All @@ -124,10 +116,6 @@
}
],
"someInteger": [
{
"key": "KBC.datatype.type",
"value": "int"
},
{
"key": "KBC.datatype.nullable",
"value": true
Expand All @@ -152,10 +140,6 @@
"key": "KBC.sanitizedName",
"value": "someInteger"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
Expand All @@ -166,10 +150,6 @@
}
],
"someDecimal": [
{
"key": "KBC.datatype.type",
"value": "decimal"
},
{
"key": "KBC.datatype.nullable",
"value": true
Expand All @@ -194,10 +174,6 @@
"key": "KBC.sanitizedName",
"value": "someDecimal"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
Expand All @@ -208,10 +184,6 @@
}
],
"type": [
{
"key": "KBC.datatype.type",
"value": "varchar"
},
{
"key": "KBC.datatype.nullable",
"value": true
Expand All @@ -236,10 +208,6 @@
"key": "KBC.sanitizedName",
"value": "type"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
Expand All @@ -250,10 +218,6 @@
}
],
"datetime": [
{
"key": "KBC.datatype.type",
"value": "datetime"
},
{
"key": "KBC.datatype.nullable",
"value": false
Expand All @@ -270,10 +234,6 @@
"key": "KBC.sanitizedName",
"value": "datetime"
},
{
"key": "KBC.primaryKey",
"value": false
},
{
"key": "KBC.uniqueKey",
"value": false
Expand All @@ -283,13 +243,5 @@
"value": 6
}
]
},
"columns": [
"Weir_d_I_D",
"Weir_d_Na_me",
"someInteger",
"someDecimal",
"type",
"datetime"
]
}
}
Loading

0 comments on commit 9d3595f

Please sign in to comment.