From c2643a45b0dc05c4fd82ec7d32577700dae7450e Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 12 Mar 2017 19:33:31 +0100 Subject: Qlite: Return OptionalRow instead of Row?, add ability to remove columns on version upgrade --- libdino/src/service/database.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libdino/src') diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index b50581f8..885a1a8f 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -121,7 +121,7 @@ public class Database : Qlite.Database { public AvatarTable avatar { get; private set; } public EntityFeatureTable entity_feature { get; private set; } - public Database(string fileName) { + public Database(string fileName) throws DatabaseError { base(fileName, VERSION); account = new AccountTable(this); jid = new JidTable(this); @@ -174,7 +174,7 @@ public class Database : Qlite.Database { } private Account? get_account_by_id(int id) { - Row? row = account.row_with(account.id, id); + Row? row = account.row_with(account.id, id).inner; if (row != null) { return get_account_from_row(row); } @@ -300,7 +300,7 @@ public class Database : Qlite.Database { } public Message? get_message_by_id(int id) { - Row? row = message.row_with(message.id, id); + Row? row = message.row_with(message.id, id).inner; if (row != null) { return get_message_from_row(row); } @@ -427,7 +427,7 @@ public class Database : Qlite.Database { private int get_jid_id(Jid jid_obj) { - Row? row = jid.row_with(jid.bare_jid, jid_obj.bare_jid.to_string()); + Row? row = jid.row_with(jid.bare_jid, jid_obj.bare_jid.to_string()).inner; return row != null ? row[jid.id] : add_jid(jid_obj); } -- cgit v1.2.3-70-g09d2