0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 08:18:20 +02:00

ircd::db: Add iov append for json::tuple.

This commit is contained in:
Jason Volk 2017-10-15 21:13:44 -07:00
parent 124f7ea12a
commit 0d2430fc32

View file

@ -82,6 +82,7 @@ struct ircd::db::iov::append
append(iov &, const row::delta &);
append(iov &, const delta &);
append(iov &, const string_view &key, const json::iov &);
template<class... T> append(iov &, const string_view &key, const json::tuple<T...> &);
};
struct ircd::db::iov::checkpoint
@ -97,3 +98,20 @@ struct ircd::db::iov::opts
size_t reserve_bytes = 0;
size_t max_bytes = 0;
};
template<class... T>
ircd::db::iov::append::append(iov &iov,
const string_view &key,
const json::tuple<T...> &tuple)
{
for_each(tuple, [&iov, &key](const auto &col, auto&& val)
{
if(defined(val)) append
{
iov, delta
{
col, key, byte_view<string_view>{val}
}
};
});
}