We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5b9690 commit 97a5281Copy full SHA for 97a5281
src/Dialects/MySQL.php
@@ -21,10 +21,15 @@ class MySQL extends DialectAbstract{
21
public function insert(string $table, array $fields, string $onConflict = null):array{
22
$onConflict = strtoupper($onConflict);
23
24
- $sql = ['INSERT'];
25
-
26
- if(in_array($onConflict, ['IGNORE'], true)){
27
- $sql[] = $onConflict;
+ switch($onConflict){
+ case 'IGNORE':
+ $sql = ['INSERT IGNORE'];
+ break;
28
+ case 'REPLACE':
29
+ $sql = ['REPLACE'];
30
31
+ default:
32
+ $sql = ['INSERT'];
33
}
34
35
$sql[] = 'INTO';
0 commit comments