[geary/mjog/db-result-timing: 3/3] Geary.Db.DatabaseConnection: Use a prepared prepared statement for exec
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/db-result-timing: 3/3] Geary.Db.DatabaseConnection: Use a prepared prepared statement for exec
- Date: Tue, 8 Sep 2020 11:58:06 +0000 (UTC)
commit cfc61bcacbf027e6cb6df30a2b30d64210acb485
Author: Michael Gratton <mike vee net>
Date: Tue Sep 8 08:34:23 2020 +1000
Geary.Db.DatabaseConnection: Use a prepared prepared statement for exec
Rather than just passing SQL to SQLite in `exec`, use a prepared
statement and drain its results so we get elapsed time warnings for
that as well.
src/engine/db/db-database-connection.vala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/db/db-database-connection.vala b/src/engine/db/db-database-connection.vala
index dd311bea6..1c5301e7b 100644
--- a/src/engine/db/db-database-connection.vala
+++ b/src/engine/db/db-database-connection.vala
@@ -137,7 +137,11 @@ public class Geary.Db.DatabaseConnection : Context, Connection {
}
check_cancelled("Connection.exec", cancellable);
- throw_on_error("Connection.exec", db.exec(sql), sql);
+ check_cancelled("Connection.exec", cancellable);
+ var result = prepare(sql).exec(cancellable);
+ while (!result.finished) {
+ result.next(cancellable);
+ }
}
/** {@inheritDoc} */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]