aboutsummaryrefslogtreecommitdiff
path: root/qlite/src/upsert_builder.vala
diff options
context:
space:
mode:
Diffstat (limited to 'qlite/src/upsert_builder.vala')
-rw-r--r--qlite/src/upsert_builder.vala14
1 files changed, 7 insertions, 7 deletions
diff --git a/qlite/src/upsert_builder.vala b/qlite/src/upsert_builder.vala
index eb835027..54ba9924 100644
--- a/qlite/src/upsert_builder.vala
+++ b/qlite/src/upsert_builder.vala
@@ -26,14 +26,14 @@ public class UpsertBuilder : StatementBuilder {
return this;
}
- public UpsertBuilder value_null<T>(Column<T> column) throws DatabaseError {
- if (column.not_null) throw new DatabaseError.ILLEGAL_QUERY(@"Can't set non-null column $(column.name) to null");
+ public UpsertBuilder value_null<T>(Column<T> column) {
+ if (column.not_null) error("Can't set non-null column %s to null", column.name);
fields += new NullField<T>(column);
return this;
}
- internal override Statement prepare() throws DatabaseError {
- throw new DatabaseError.NOT_SUPPORTED("prepare() not available for upsert.");
+ internal override Statement prepare() {
+ error("prepare() not available for upsert.");
}
internal Statement prepare_update() {
@@ -98,13 +98,13 @@ public class UpsertBuilder : StatementBuilder {
return stmt;
}
- public int64 perform() throws DatabaseError {
+ public int64 perform() {
if (prepare_update().step() != DONE || prepare_insert().step() != DONE) {
- throw new DatabaseError.EXEC_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())");
+ error(@"SQLite error: %d - %s", db.errcode(), db.errmsg());
}
return db.last_insert_rowid();
}
}
-} \ No newline at end of file
+}