Skip to content

Commit ac29652

Browse files
authored
Update PostgresGrammar.php
1 parent 98f0ce9 commit ac29652

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Illuminate/Database/Query/Grammars/PostgresGrammar.php

+14
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ public function compileInsertGetId(Builder $query, $values, $sequence)
8181

8282
return $this->compileInsert($query, $values).' returning '.$this->wrap($sequence);
8383
}
84+
85+
/**
86+
* @inheritdoc
87+
*/
88+
public function compileInsert(Builder $query, array $values)
89+
{
90+
$table = $this->wrapTable($query->from);
91+
92+
if (empty($values)) {
93+
return "insert into $table DEFAULT VALUES";
94+
}
95+
96+
return parent::compileInsert($query, $values);
97+
}
8498

8599
/**
86100
* Compile an update statement into SQL.

0 commit comments

Comments
 (0)