v2.4.4: DatabaseEntity migration and bugfixes

This commit is contained in:
2024-05-21 12:32:44 +02:00
parent b96d0d053c
commit 037f0fae91
14 changed files with 249 additions and 47 deletions

View File

@@ -375,7 +375,10 @@ class MySQL extends SQL {
list ($name, $alias) = $parts;
return "`$name` $alias";
} else {
return "`$table`";
$parts = explode(".", $table);
return implode(".", array_map(function ($n) {
return "`$n`";
}, $parts));
}
}
}
@@ -484,6 +487,27 @@ class MySQL extends SQL {
return $res && $res[0]["count"] > 0;
}
public function listTables(): ?array {
$tableSchema = $this->connectionData->getProperty("database");
$res = $this->select("TABLE_NAME")
->from("information_schema.TABLES")
->where(new Compare("TABLE_SCHEMA", $tableSchema, "=", true))
->where(new CondLike(new Column("TABLE_TYPE"), "BASE TABLE"))
->execute();
if ($res !== false) {
$tableNames = [];
foreach ($res as $row) {
$tableNames[] = $row["TABLE_NAME"];
}
return $tableNames;
}
return null;
}
}
class RowIteratorMySQL extends RowIterator {