Skip to content

Commit 79c57b3

Browse files
Enable Schema Configuration for hyperf/db (#7314)
1 parent 20e5b99 commit 79c57b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PgSQL/PgSQLConnection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public function reconnect(): bool
6565
throw new RuntimeException($connection->error);
6666
}
6767

68+
if (! empty($this->config['schema'])) {
69+
$connection->query(sprintf('set search_path to %s', $this->config['schema']));
70+
}
71+
6872
$this->connection = $connection;
6973
$this->lastUseTime = microtime(true);
7074
$this->transactions = 0;

0 commit comments

Comments
 (0)