aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-02-02 00:03:59 +0100
committerGravatar GitHub <noreply@github.com> 2021-02-02 00:03:59 +0100
commit1ee1fcce91d64c8cee6b8621aaedbdeae0c9c330 (patch)
tree2359a744b9711cd5bd51d168461333095d4a64c2 /app/Models/EntryDAOSQLite.php
parent8285f1df43ce19bbd533c70c3fd1487908883725 (diff)
INSERT ... ON CONFLIT DO NOTHING for addEntry (#3409)
#fix https://github.com/FreshRSS/FreshRSS/issues/3402 Explicit `INSERT OR IGNORE` / `ON CONFLICT DO NOTHING` for the `addEntry()` method, which does expect some duplicates.
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 12e8f27e1..e53583654 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -14,6 +14,10 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
return $x;
}
+ public function sqlIgnoreConflict($sql) {
+ return str_replace('INSERT INTO ', 'INSERT OR IGNORE INTO ', $sql);
+ }
+
protected function autoUpdateDb($errorInfo) {
if ($tableInfo = $this->pdo->query("SELECT sql FROM sqlite_master where name='tag'")) {
$showCreate = $tableInfo->fetchColumn();