v2.4.4: DatabaseEntity migration and bugfixes
This commit is contained in:
@@ -334,7 +334,10 @@ class PostgreSQL extends SQL {
|
||||
list ($name, $alias) = $parts;
|
||||
return "\"$name\" $alias";
|
||||
} else {
|
||||
return "\"$table\"";
|
||||
$parts = explode(".", $table);
|
||||
return implode(".", array_map(function ($n) {
|
||||
return "\"$n\"";
|
||||
}, $parts));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -463,6 +466,28 @@ class PostgreSQL extends SQL {
|
||||
|
||||
return $res && $res[0]["count"] > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function listTables(): ?array {
|
||||
$tableSchema = $this->connectionData->getProperty("database");
|
||||
$res = $this->select("tablename")
|
||||
->from("pg_tables")
|
||||
->where(new Compare("schemaname", $tableSchema))
|
||||
->execute();
|
||||
|
||||
if ($res !== false) {
|
||||
$tableNames = [];
|
||||
|
||||
foreach ($res as $row) {
|
||||
$tableNames[] = $row["tablename"];
|
||||
}
|
||||
|
||||
return $tableNames;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class RowIteratorPostgreSQL extends RowIterator {
|
||||
|
||||
Reference in New Issue
Block a user