From 2b7358aa60e7718990087394ecb64a6a1211235c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 28 Apr 2018 19:05:17 -0700 Subject: [PATCH] ircd::m::dbs: Conditional indexer; pass db::op from opts for indexer. --- include/ircd/m/dbs.h | 1 + ircd/m/dbs.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ircd/m/dbs.h b/include/ircd/m/dbs.h index bc83f2717..35e8d7439 100644 --- a/include/ircd/m/dbs.h +++ b/include/ircd/m/dbs.h @@ -69,6 +69,7 @@ struct ircd::m::dbs::write_opts db::op op {db::op::SET}; bool present {true}; bool history {true}; + bool indexer {true}; }; /// Database Schema Descriptors diff --git a/ircd/m/dbs.cc b/ircd/m/dbs.cc index c94350dcd..0f22d2ea3 100644 --- a/ircd/m/dbs.cc +++ b/ircd/m/dbs.cc @@ -115,11 +115,11 @@ ircd::m::dbs::write(db::txn &txn, "Cannot write to database: no index specified for event." }; - db::txn::append + if(opts.indexer) db::txn::append { txn, dbs::event_idx, { - db::op::SET, + opts.op, at<"event_id"_>(event), byte_view(opts.idx) }