diff options
author | Marvin W <git@larma.de> | 2017-03-09 21:46:16 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-10 17:33:27 +0100 |
commit | 93fd134a92fb50cc6e8a9b5db3d6f25e84e6fa10 (patch) | |
tree | 760dffada9b7d3515df5be306fe3a2ae9d848a64 /qlite/src/delete_builder.vala | |
parent | 9b8cf706d6b0ff83472af53c31b96c4c2f55f6b7 (diff) | |
download | dino-93fd134a92fb50cc6e8a9b5db3d6f25e84e6fa10.tar.gz dino-93fd134a92fb50cc6e8a9b5db3d6f25e84e6fa10.zip |
Fix bugs and warnings in qlite
Diffstat (limited to 'qlite/src/delete_builder.vala')
-rw-r--r-- | qlite/src/delete_builder.vala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qlite/src/delete_builder.vala b/qlite/src/delete_builder.vala index 5999dc40..679c8284 100644 --- a/qlite/src/delete_builder.vala +++ b/qlite/src/delete_builder.vala @@ -16,8 +16,8 @@ public class DeleteBuilder : StatementBuilder { base(db); } - public DeleteBuilder from(Table table) { - if (table != null) throw new DatabaseError.ILLEGAL_QUERY("cannot use from() multiple times."); + public DeleteBuilder from(Table table) throws DatabaseError { + if (this.table != null) throw new DatabaseError.ILLEGAL_QUERY("cannot use from() multiple times."); this.table = table; this.table_name = table.name; return this; @@ -28,8 +28,8 @@ public class DeleteBuilder : StatementBuilder { return this; } - public DeleteBuilder where(string selection, string[]? selection_args = null) { - if (selection != null) throw new DatabaseError.ILLEGAL_QUERY("selection was already done, but where() was called."); + public DeleteBuilder where(string selection, string[]? selection_args = null) throws DatabaseError { + if (this.selection != null) throw new DatabaseError.ILLEGAL_QUERY("selection was already done, but where() was called."); this.selection = selection; if (selection_args != null) { this.selection_args = new StatementBuilder.Field[selection_args.length]; @@ -56,7 +56,7 @@ public class DeleteBuilder : StatementBuilder { return this; } - public override Statement prepare() { + public override Statement prepare() throws DatabaseError { Statement stmt = db.prepare(@"DELETE FROM $table_name $(selection != null ? @"WHERE $selection": "")"); for (int i = 0; i < selection_args.length; i++) { selection_args[i].bind(stmt, i+1); @@ -64,7 +64,7 @@ public class DeleteBuilder : StatementBuilder { return stmt; } - public void perform() { + public void perform() throws DatabaseError { if (prepare().step() != DONE) { throw new DatabaseError.EXEC_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())"); } |