diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-20 22:12:20 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-20 22:28:32 +0100 |
commit | 6f3225979cb497db99381556adb7e42119b44ec3 (patch) | |
tree | 1f7352d12eaf1aec7a38d388d3b1917bcd06e479 /qlite | |
parent | db57a973534f099af2b150f1a1307d1948553d9f (diff) | |
download | dino-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.vala | 12 |
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())"); } } |