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 9de9ad2 commit 3b32300Copy full SHA for 3b32300
1 file changed
lib/private/DB/AdapterPgSql.php
@@ -35,4 +35,16 @@ public function fixupStatement($statement) {
35
$statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
36
return $statement;
37
}
38
+
39
+ public function insertIgnoreConflict($table, $input) : int {
40
+ $builder = $this->conn->getQueryBuilder();
41
+ $builder->insert($table)
42
+ ->values($input);
43
+ foreach($input as $key => $value) {
44
+ $builder->setValue($key, $builder->createNamedParameter($value));
45
+ }
46
+ $queryString = $builder->getSQL() . ' ON CONFLICT DO NOTHING';
47
+ $inserts = array_values($input);
48
+ return $this->conn->executeUpdate($queryString, $inserts);
49
50
0 commit comments