0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️:event::fetch: Add option for tight-to-selections.

This commit is contained in:
Jason Volk 2019-01-16 18:35:58 -08:00
parent a6a740bbf6
commit a61d9e5d96
2 changed files with 8 additions and 4 deletions

View file

@ -109,6 +109,11 @@ struct ircd::m::event::fetch::opts
/// json query anyway.
bool query_json_force {false};
/// Whether to enforce the keys populated with values are tight to those
/// keys specified here. This is naturally true for row queries anyway,
/// but json queries may have more data than is being sought.
bool selected_only {false};
opts(const event::keys &, const db::gopts & = {});
opts(const event::keys::selection &, const db::gopts & = {});
opts(const db::gopts &, const event::keys::selection & = {});

View file

@ -1546,10 +1546,9 @@ ircd::m::seek(event::fetch &fetch,
fetch._json.val()
};
event =
{
source, opts.keys
};
event = opts.selected_only?
m::event{source, opts.keys}:
m::event{source};
assert(data(event.source) == data(source));
assert(fetch.valid);