Skip to content

Commit 250e7f8

Browse files
committed
调整pgsql驱动getTables方法 支持传入schemaName
1 parent 7257fe8 commit 250e7f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/db/connector/Pgsql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ public function getFields(string $tableName): array
135135
*
136136
* @return array
137137
*/
138-
public function getTables(string $dbName = ''): array
138+
public function getTables(string $dbName = 'public'): array
139139
{
140-
$sql = "SELECT tablename FROM pg_tables WHERE schemaname = 'public' ORDER BY tablename";
140+
$sql = "SELECT tablename FROM pg_tables WHERE schemaname = '$dbName' ORDER BY tablename";
141141
$pdo = $this->getPDOStatement($sql);
142142
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
143143

0 commit comments

Comments
 (0)