Skip to content

Commit b62e08b

Browse files
Merge pull request #62 from AmirHossein/patch-1
Add connection to grammer
2 parents 72ec5ff + 6d8f07f commit b62e08b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Connect/Connection.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public function getSchemaBuilder()
3232
*/
3333
protected function getDefaultQueryGrammar()
3434
{
35-
return $this->withTablePrefix(new Query\Grammar);
35+
$grammar = new Query\Grammar;
36+
if (method_exists($grammar, 'setConnection')) {
37+
$grammar->setConnection($this);
38+
}
39+
return $this->withTablePrefix($grammar);
3640
}
3741

3842
/**
@@ -42,7 +46,11 @@ protected function getDefaultQueryGrammar()
4246
*/
4347
protected function getDefaultSchemaGrammar()
4448
{
45-
return $this->withTablePrefix(new Schema\Grammar);
49+
$grammar = new Schema\Grammar;
50+
if (method_exists($grammar, 'setConnection')) {
51+
$grammar->setConnection($this);
52+
}
53+
return $this->withTablePrefix($grammar);
4654
}
4755

4856
/**

0 commit comments

Comments
 (0)