Skip to content

Commit a22cf5b

Browse files
committed
Add COLUMN_TYPE MySQL reflection
1 parent a94c4f6 commit a22cf5b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,6 +3562,9 @@ public function __construct(string $name, string $type, int $length, int $precis
35623562

35633563
private static function parseColumnType(string $columnType, int &$length, int &$precision, int &$scale) /*: void*/
35643564
{
3565+
if (!$columnType) {
3566+
return;
3567+
}
35653568
$pos = strpos($columnType, '(');
35663569
if ($pos) {
35673570
$dataSize = rtrim(substr($columnType, $pos + 1), ')');
@@ -3603,9 +3606,7 @@ public static function fromReflection(GenericReflection $reflection, array $colu
36033606
$precision = (int) $columnResult['NUMERIC_PRECISION'];
36043607
$scale = (int) $columnResult['NUMERIC_SCALE'];
36053608
$columnType = $columnResult['COLUMN_TYPE'];
3606-
if ($columnType) {
3607-
self::parseColumnType($columnType, $length, $precision, $scale);
3608-
}
3609+
self::parseColumnType($columnType, $length, $precision, $scale);
36093610
$dataSize = self::getDataSize($length, $precision, $scale);
36103611
$type = $reflection->toJdbcType($dataType, $dataSize);
36113612
$nullable = in_array(strtoupper($columnResult['IS_NULLABLE']), ['TRUE', 'YES', 'T', 'Y', '1']);
@@ -10341,7 +10342,6 @@ public static function toString(ResponseInterface $response): string
1034110342
'username' => 'php-crud-api',
1034210343
'password' => 'php-crud-api',
1034310344
'database' => 'php-crud-api',
10344-
'controllers' => 'records,columns,openapi',
1034510345
]);
1034610346
$request = RequestFactory::fromGlobals();
1034710347
$api = new Api($config);

src/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
'username' => 'php-crud-api',
1414
'password' => 'php-crud-api',
1515
'database' => 'php-crud-api',
16-
'controllers' => 'records,columns,openapi',
1716
]);
1817
$request = RequestFactory::fromGlobals();
1918
$api = new Api($config);

0 commit comments

Comments
 (0)