Skip to content

Commit 3eec96e

Browse files
authored
Fix wrong placement of IGNORE statement in Postgres
1 parent 0d45be6 commit 3eec96e

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

system/Database/Postgre/Builder.php

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,37 @@ public function replace(array $set = null)
204204
return $result;
205205
}
206206

207-
//--------------------------------------------------------------------
207+
/**
208+
* Insert statement
209+
*
210+
* Generates a platform-specific insert string from the supplied data
211+
*
212+
* @param string $table The table name
213+
* @param array $keys The insert keys
214+
* @param array $unescapedKeys The insert values
215+
*
216+
* @return string
217+
*/
218+
protected function _insert(string $table, array $keys, array $unescapedKeys): string
219+
{
220+
return trim(sprintf('INSERT INTO %s (%s) VALUES (%s) %s', $table, implode(', ', $keys), implode(', ', $unescapedKeys), $this->compileIgnore('insert')));
221+
}
222+
223+
/**
224+
* Insert batch statement
225+
*
226+
* Generates a platform-specific insert string from the supplied data.
227+
*
228+
* @param string $table Table name
229+
* @param array $keys INSERT keys
230+
* @param array $values INSERT values
231+
*
232+
* @return string
233+
*/
234+
protected function _insertBatch(string $table, array $keys, array $values): string
235+
{
236+
return trim(sprintf('INSERT INTO %s (%s) VALUES %s %s', $table, implode(', ', $keys), implode(', ', $values), $this->compileIgnore('insert')));
237+
}
208238

209239
/**
210240
* Delete

0 commit comments

Comments
 (0)