aboutsummaryrefslogtreecommitdiff
path: root/qlite
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-20 22:12:20 +0100
committerfiaxh <git@mx.ax.lt>2017-03-20 22:28:32 +0100
commit6f3225979cb497db99381556adb7e42119b44ec3 (patch)
tree1f7352d12eaf1aec7a38d388d3b1917bcd06e479 /qlite
parentdb57a973534f099af2b150f1a1307d1948553d9f (diff)
downloaddino-6f3225979cb497db99381556adb7e42119b44ec3.tar.gz
dino-6f3225979cb497db99381556adb7e42119b44ec3.zip
Select conversation on startup, placeholder for "No conversation selected", start services before UI
Diffstat (limited to 'qlite')
-rw-r--r--qlite/src/row.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/qlite/src/row.vala b/qlite/src/row.vala
index de10751f..ed0552a0 100644
--- a/qlite/src/row.vala
+++ b/qlite/src/row.vala
@@ -53,6 +53,7 @@ public class Row {
}
public class RowIterator {
+ private Database db;
private Statement stmt;
public RowIterator.from_query_builder(QueryBuilder query) throws DatabaseError {
@@ -60,6 +61,7 @@ public class RowIterator {
}
public RowIterator(Database db, string sql, string[]? args = null) throws DatabaseError {
+ this.db = db;
this.stmt = db.prepare(sql);
if (args != null) {
for (int i = 0; i < args.length; i++) {
@@ -68,11 +70,11 @@ public class RowIterator {
}
}
- public Row? next_value() {
- if (stmt.step() == Sqlite.ROW) {
- return new Row(stmt);
- }
- return null;
+ public Row? next_value() throws DatabaseError {
+ int r = stmt.step();
+ if (r == Sqlite.ROW) return new Row(stmt);
+ if (r == Sqlite.DONE) return null;
+ throw new DatabaseError.EXEC_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())");
}
}