diff --git a/src/PostgresEnhancedConnection.php b/src/PostgresEnhancedConnection.php index c643c04..1879141 100644 --- a/src/PostgresEnhancedConnection.php +++ b/src/PostgresEnhancedConnection.php @@ -117,12 +117,11 @@ public function serverVersion(): string protected function getDefaultQueryGrammar(): QueryGrammar { $grammar = new QueryGrammar(); - $grammar->setTablePrefix($this->tablePrefix); if (method_exists($grammar, 'setConnection')) { $grammar->setConnection($this); } - return $grammar; + return $this->withTablePrefix($grammar); } /** @@ -131,12 +130,11 @@ protected function getDefaultQueryGrammar(): QueryGrammar protected function getDefaultSchemaGrammar(): SchemaGrammar { $grammar = new SchemaGrammar(); - $grammar->setTablePrefix($this->tablePrefix); if (method_exists($grammar, 'setConnection')) { $grammar->setConnection($this); } - return $grammar; + return $this->withTablePrefix($grammar); } /**