aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/sqlite/Util.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/sqlite/Util.hxx')
-rw-r--r--src/lib/sqlite/Util.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/sqlite/Util.hxx b/src/lib/sqlite/Util.hxx
index 3a7d34a13..fbc773ed4 100644
--- a/src/lib/sqlite/Util.hxx
+++ b/src/lib/sqlite/Util.hxx
@@ -137,6 +137,17 @@ ExecuteChanges(sqlite3_stmt *stmt)
return sqlite3_changes(sqlite3_db_handle(stmt));
}
+/**
+ * Wrapper for ExecuteChanges() that returns true if at least one row
+ * was modified. Returns false if nothing was modified or if an error
+ * occurred.
+ */
+static inline bool
+ExecuteModified(sqlite3_stmt *stmt)
+{
+ return ExecuteChanges(stmt) > 0;
+}
+
template<typename F>
static inline bool
ExecuteForEach(sqlite3_stmt *stmt, F &&f)