0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::db: Consolidate write(column) overloads.

This commit is contained in:
Jason Volk 2018-04-30 07:18:06 -07:00
parent ec4453404e
commit 9af649f739
2 changed files with 4 additions and 19 deletions

View file

@ -39,8 +39,7 @@ namespace ircd::db
std::string read(column &, const string_view &key, const gopts & = {});
// [SET] Write data to the db
void write(column &, const string_view &key, const string_view &value, const sopts & = {});
void write(column &, const string_view &key, const mutable_buffer &, const sopts & = {});
void write(column &, const string_view &key, const const_buffer &value, const sopts & = {});
// [SET] Remove data from the db. not_found is never thrown.
void del(column &, const string_view &key, const sopts & = {});

View file

@ -4084,21 +4084,7 @@ ircd::db::del(column &column,
void
ircd::db::write(column &column,
const string_view &key,
const mutable_buffer &buf,
const sopts &sopts)
{
const string_view val
{
reinterpret_cast<const char *>(data(buf)), size(buf)
};
write(column, key, val, sopts);
}
void
ircd::db::write(column &column,
const string_view &key,
const string_view &val,
const const_buffer &val,
const sopts &sopts)
{
database &d(column);
@ -4107,8 +4093,8 @@ ircd::db::write(column &column,
name(d),
sequence(d),
name(c),
key.size(),
val.size());
size(key),
size(val));
auto opts(make_opts(sopts));
throw_on_error