summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/tablepatch.cpp11
-rw-r--r--libdbpp/tablepatch.h6
2 files changed, 13 insertions, 4 deletions
diff --git a/libdbpp/tablepatch.cpp b/libdbpp/tablepatch.cpp
index f902739..dc42a42 100644
--- a/libdbpp/tablepatch.cpp
+++ b/libdbpp/tablepatch.cpp
@@ -10,7 +10,10 @@
DB::TablePatch::TablePatch() :
insteadOfDelete(nullptr),
where(nullptr),
- order(nullptr)
+ order(nullptr),
+ doDeletes(true),
+ doUpdates(true),
+ doInserts(true)
{
}
@@ -25,9 +28,9 @@ DB::Connection::patchTable(TablePatch * tp)
}
TransactionScope tx(this);
return {
- patchDeletes(tp),
- patchUpdates(tp),
- patchInserts(tp)
+ tp->doDeletes ? patchDeletes(tp) : 0,
+ tp->doUpdates ? patchUpdates(tp) : 0,
+ tp->doInserts ? patchInserts(tp) : 0
};
}
diff --git a/libdbpp/tablepatch.h b/libdbpp/tablepatch.h
index b197254..a8f5e59 100644
--- a/libdbpp/tablepatch.h
+++ b/libdbpp/tablepatch.h
@@ -38,6 +38,12 @@ namespace DB {
SqlWriter * where;
/// An optional SQL writer to append an order by clause.
SqlWriter * order;
+ /// Enable deletion
+ bool doDeletes;
+ /// Enable updates
+ bool doUpdates;
+ /// Enable insertion
+ bool doInserts;
};
}