aboutsummaryrefslogtreecommitdiff
path: root/qlite/src/database.vala
diff options
context:
space:
mode:
Diffstat (limited to 'qlite/src/database.vala')
-rw-r--r--qlite/src/database.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/qlite/src/database.vala b/qlite/src/database.vala
index cc46ee21..ac53d51c 100644
--- a/qlite/src/database.vala
+++ b/qlite/src/database.vala
@@ -41,6 +41,7 @@ public class Database {
}
this.tables = tables;
start_migration();
+ if (debug) db.trace((message) => print(@"Qlite trace: $message\n"));
}
public void ensure_init() throws DatabaseError {
@@ -114,6 +115,11 @@ public class Database {
return new UpdateBuilder(this, table);
}
+ public UpsertBuilder upsert(Table table) throws DatabaseError {
+ ensure_init();
+ return new UpsertBuilder(this, table);
+ }
+
public UpdateBuilder update_named(string table) throws DatabaseError {
ensure_init();
return new UpdateBuilder.for_name(this, table);
@@ -131,7 +137,6 @@ public class Database {
internal Statement prepare(string sql) throws DatabaseError {
ensure_init();
- if (debug) print(@"prepare: $sql\n");
Sqlite.Statement statement;
if (db.prepare_v2(sql, sql.length, out statement) != OK) {
throw new DatabaseError.PREPARE_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())");