From e8f095f821ce218264bc3e7c5ad2414d756c2f9b Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 24 Apr 2022 12:11:57 +0200 Subject: [PATCH] shared: sqlitedbservice: Call prepare(), don't pass query in constructor for consistency --- shared/sqlitedbservice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/sqlitedbservice.cpp b/shared/sqlitedbservice.cpp index 57525e9..8fdc05b 100644 --- a/shared/sqlitedbservice.cpp +++ b/shared/sqlitedbservice.cpp @@ -7,7 +7,8 @@ #include "logger.h" bool SqliteDbService::fileExistsInDatabase(QString path, qint64 mtime) { - auto query = QSqlQuery("SELECT 1 FROM file WHERE path = ? and mtime = ?", dbFactory->forCurrentThread()); + auto query = QSqlQuery(dbFactory->forCurrentThread()); + query.prepare("SELECT 1 FROM file WHERE path = ? and mtime = ?"); query.addBindValue(path); query.addBindValue(mtime); if(!query.exec())