aboutsummaryrefslogtreecommitdiff
path: root/qlite
diff options
context:
space:
mode:
Diffstat (limited to 'qlite')
-rw-r--r--qlite/src/upsert_builder.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/qlite/src/upsert_builder.vala b/qlite/src/upsert_builder.vala
index 7daf7109..79104972 100644
--- a/qlite/src/upsert_builder.vala
+++ b/qlite/src/upsert_builder.vala
@@ -26,9 +26,13 @@ public class UpsertBuilder : StatementBuilder {
return this;
}
- public UpsertBuilder value_null<T>(Column<T> column) {
+ public UpsertBuilder value_null<T>(Column<T> column, bool key = false) {
if (column.not_null) error("Can't set non-null column %s to null", column.name);
- fields += new NullField<T>(column);
+ if (key) {
+ keys += new NullField<T>(column);
+ } else {
+ fields += new NullField<T>(column);
+ }
return this;
}