Skip to content

Commit d43bfbe

Browse files
committed
bugfix
1 parent 6d0f5eb commit d43bfbe

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

api.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4255,11 +4255,6 @@ public function getTableNames(): array
42554255
return $this->database()->getTableNames();
42564256
}
42574257

4258-
public function getDatabaseName(): string
4259-
{
4260-
return $this->database()->getName();
4261-
}
4262-
42634258
public function removeTable(string $tableName): bool
42644259
{
42654260
unset($this->tables[$tableName]);
@@ -6274,7 +6269,7 @@ public function getTableColumns(string $tableName, string $type): array
62746269
if ($this->driver == 'sqlite') {
62756270
foreach ($results as &$result) {
62766271
// mysql does not properly reflect display width of types
6277-
preg_match('|([a-z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
6272+
preg_match('|([a-zA-Z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
62786273
if (isset($matches[1])) {
62796274
$result['DATA_TYPE'] = $matches[1];
62806275
} else {
@@ -6321,7 +6316,7 @@ public function toJdbcType(string $type, string $size): string
63216316
private function query(string $sql, array $parameters): array
63226317
{
63236318
$stmt = $this->pdo->prepare($sql);
6324-
//echo "- $sql -- " . json_encode($parameters, JSON_UNESCAPED_UNICODE) . "\n";
6319+
// echo "- $sql -- " . json_encode($parameters, JSON_UNESCAPED_UNICODE) . "\n";
63256320
$stmt->execute($parameters);
63266321
return $stmt->fetchAll();
63276322
}

src/Tqdev/PhpCrudApi/Column/ReflectionService.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ public function getTableNames(): array
9595
return $this->database()->getTableNames();
9696
}
9797

98-
public function getDatabaseName(): string
99-
{
100-
return $this->database()->getName();
101-
}
102-
10398
public function removeTable(string $tableName): bool
10499
{
105100
unset($this->tables[$tableName]);

src/Tqdev/PhpCrudApi/Database/GenericReflection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function getTableColumns(string $tableName, string $type): array
199199
if ($this->driver == 'sqlite') {
200200
foreach ($results as &$result) {
201201
// mysql does not properly reflect display width of types
202-
preg_match('|([a-z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
202+
preg_match('|([a-zA-Z]+)(\(([0-9]+)(,([0-9]+))?\))?|', $result['DATA_TYPE'], $matches);
203203
if (isset($matches[1])) {
204204
$result['DATA_TYPE'] = $matches[1];
205205
} else {
@@ -246,7 +246,7 @@ public function toJdbcType(string $type, string $size): string
246246
private function query(string $sql, array $parameters): array
247247
{
248248
$stmt = $this->pdo->prepare($sql);
249-
//echo "- $sql -- " . json_encode($parameters, JSON_UNESCAPED_UNICODE) . "\n";
249+
// echo "- $sql -- " . json_encode($parameters, JSON_UNESCAPED_UNICODE) . "\n";
250250
$stmt->execute($parameters);
251251
return $stmt->fetchAll();
252252
}

0 commit comments

Comments
 (0)