Refactor getTables()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
319ae0d2e3
commit
c4f4a1ee9e
@ -303,12 +303,19 @@ class DatabaseInterface implements DbalInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
/** @var array<int, string> $tables */
|
||||
$tables = $this->fetchResultSimple(
|
||||
$result = $this->tryQuery(
|
||||
'SHOW TABLES FROM ' . Util::backquote($database) . ';',
|
||||
0,
|
||||
$connectionType,
|
||||
cacheAffectedRows: false,
|
||||
);
|
||||
|
||||
if ($result === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
/** @var list<string> $tables */
|
||||
$tables = $result->fetchAllColumn();
|
||||
|
||||
if ($this->config->settings['NaturalOrder']) {
|
||||
usort($tables, strnatcasecmp(...));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user