mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 14:31:11 +01:00
ircd:Ⓜ️:dbs: Add missing and fix inconsistent tuple typedefs for columns.
This commit is contained in:
parent
04c81a41ed
commit
f1676fdb80
18 changed files with 39 additions and 24 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using event_horizon_tuple = std::tuple<event::idx>;
|
||||
|
||||
constexpr size_t EVENT_HORIZON_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE + 1 + 8
|
||||
|
@ -20,7 +22,7 @@ namespace ircd::m::dbs
|
|||
|
||||
string_view event_horizon_key(const mutable_buffer &out, const id::event &, const event::idx &);
|
||||
string_view event_horizon_key(const mutable_buffer &out, const id::event &);
|
||||
std::tuple<event::idx> event_horizon_key(const string_view &amalgam);
|
||||
event_horizon_tuple event_horizon_key(const string_view &amalgam);
|
||||
|
||||
size_t _prefetch_event_horizon_resolve(const event &, const opts &);
|
||||
void _index_event_horizon_resolve(db::txn &, const event &, const opts &); //query
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using event_refs_tuple = std::tuple<ref, event::idx>;
|
||||
|
||||
constexpr size_t EVENT_REFS_KEY_MAX_SIZE
|
||||
{
|
||||
sizeof(event::idx) + sizeof(event::idx)
|
||||
|
@ -34,7 +36,7 @@ namespace ircd::m::dbs
|
|||
const ref &type,
|
||||
const event::idx &referer);
|
||||
|
||||
std::tuple<ref, event::idx>
|
||||
event_refs_tuple
|
||||
event_refs_key(const string_view &amalgam);
|
||||
|
||||
string_view
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using event_sender_tuple = std::tuple<event::idx>;
|
||||
using event_sender_origin_tuple = std::tuple<string_view, event::idx>;
|
||||
|
||||
constexpr size_t EVENT_SENDER_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE + 1 + 8
|
||||
|
@ -21,13 +24,13 @@ namespace ircd::m::dbs
|
|||
// sender keyspace
|
||||
bool is_event_sender_key(const string_view &amalgam);
|
||||
string_view event_sender_key(const mutable_buffer &out, const id::user &, const event::idx & = 0UL);
|
||||
std::tuple<event::idx> event_sender_key(const string_view &amalgam);
|
||||
event_sender_tuple event_sender_key(const string_view &amalgam);
|
||||
|
||||
// sender_origin keyspace
|
||||
bool is_event_sender_origin_key(const string_view &amalgam);
|
||||
string_view event_sender_origin_key(const mutable_buffer &out, const string_view &origin, const string_view &localpart = {}, const event::idx & = 0UL);
|
||||
string_view event_sender_origin_key(const mutable_buffer &out, const id::user &, const event::idx &);
|
||||
std::tuple<string_view, event::idx> event_sender_origin_key(const string_view &amalgam);
|
||||
event_sender_origin_tuple event_sender_origin_key(const string_view &amalgam);
|
||||
|
||||
void _index_event_sender(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
// state_key, type, room_id, depth, event_idx
|
||||
using event_state_tuple = std::tuple<string_view, string_view, string_view, int64_t, event::idx>;
|
||||
|
||||
constexpr size_t EVENT_STATE_KEY_MAX_SIZE
|
||||
{
|
||||
0
|
||||
|
@ -24,9 +27,6 @@ namespace ircd::m::dbs
|
|||
+ 8
|
||||
};
|
||||
|
||||
// state_key, type, room_id, depth, event_idx
|
||||
using event_state_tuple = std::tuple<string_view, string_view, string_view, int64_t, event::idx>;
|
||||
|
||||
string_view event_state_key(const mutable_buffer &out, const event_state_tuple &);
|
||||
event_state_tuple event_state_key(const string_view &);
|
||||
|
||||
|
|
|
@ -13,13 +13,15 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using event_type_tuple = std::tuple<event::idx>;
|
||||
|
||||
constexpr size_t EVENT_TYPE_KEY_MAX_SIZE
|
||||
{
|
||||
event::TYPE_MAX_SIZE + 1 + 8
|
||||
};
|
||||
|
||||
string_view event_type_key(const mutable_buffer &out, const string_view &, const event::idx & = 0);
|
||||
std::tuple<event::idx> event_type_key(const string_view &amalgam);
|
||||
event_type_tuple event_type_key(const string_view &amalgam);
|
||||
|
||||
void _index_event_type(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using room_events_tuple = std::tuple<uint64_t, event::idx>;
|
||||
|
||||
constexpr size_t ROOM_EVENTS_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE + 1 + 8 + 8
|
||||
|
@ -20,7 +22,7 @@ namespace ircd::m::dbs
|
|||
|
||||
string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth, const event::idx &);
|
||||
string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth);
|
||||
std::tuple<uint64_t, event::idx> room_events_key(const string_view &amalgam);
|
||||
room_events_tuple room_events_key(const string_view &amalgam);
|
||||
|
||||
void _index_room_events(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using room_joined_tuple = std::tuple<string_view, string_view>;
|
||||
|
||||
constexpr size_t ROOM_JOINED_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE + event::ORIGIN_MAX_SIZE + id::MAX_SIZE
|
||||
|
@ -20,7 +22,7 @@ namespace ircd::m::dbs
|
|||
|
||||
string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin, const id::user &member);
|
||||
string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin);
|
||||
std::tuple<string_view, string_view> room_joined_key(const string_view &amalgam);
|
||||
room_joined_tuple room_joined_key(const string_view &amalgam);
|
||||
|
||||
void _index_room_joined(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using room_state_tuple = std::tuple<string_view, string_view>;
|
||||
|
||||
constexpr size_t ROOM_STATE_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE + event::TYPE_MAX_SIZE + event::STATE_KEY_MAX_SIZE
|
||||
|
@ -20,7 +22,7 @@ namespace ircd::m::dbs
|
|||
|
||||
string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type, const string_view &state_key);
|
||||
string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type);
|
||||
std::tuple<string_view, string_view> room_state_key(const string_view &amalgam);
|
||||
room_state_tuple room_state_key(const string_view &amalgam);
|
||||
|
||||
void _index_room_state(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using room_state_space_key_parts = std::tuple<string_view, string_view, int64_t, event::idx>;
|
||||
using room_state_space_tuple = std::tuple<string_view, string_view, int64_t, event::idx>;
|
||||
|
||||
constexpr size_t ROOM_STATE_SPACE_KEY_MAX_SIZE
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ namespace ircd::m::dbs
|
|||
string_view room_state_space_key(const mutable_buffer &out, const id::room &, const string_view &type, const string_view &state_key);
|
||||
string_view room_state_space_key(const mutable_buffer &out, const id::room &, const string_view &type);
|
||||
string_view room_state_space_key(const mutable_buffer &out, const id::room &);
|
||||
room_state_space_key_parts room_state_space_key(const string_view &amalgam);
|
||||
room_state_space_tuple room_state_space_key(const string_view &amalgam);
|
||||
|
||||
void _index_room_state_space(db::txn &, const event &, const opts &);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
namespace ircd::m::dbs
|
||||
{
|
||||
using room_type_tuple = std::tuple<string_view, uint64_t, event::idx>;
|
||||
|
||||
constexpr size_t ROOM_TYPE_KEY_MAX_SIZE
|
||||
{
|
||||
id::MAX_SIZE // room_id
|
||||
|
@ -23,8 +25,6 @@ namespace ircd::m::dbs
|
|||
+ 8 // u64
|
||||
};
|
||||
|
||||
using room_type_tuple = std::tuple<string_view, uint64_t, event::idx>;
|
||||
|
||||
room_type_tuple
|
||||
room_type_key(const string_view &amalgam);
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ ircd::m::dbs::_index_event_horizon(db::txn &txn,
|
|||
// key
|
||||
//
|
||||
|
||||
std::tuple<ircd::m::event::idx>
|
||||
ircd::m::dbs::event_horizon_tuple
|
||||
ircd::m::dbs::event_horizon_key(const string_view &amalgam)
|
||||
{
|
||||
assert(size(amalgam) == 1 + sizeof(event::idx));
|
||||
|
|
|
@ -958,7 +958,7 @@ ircd::m::dbs::event_refs__cmp_less(const string_view &a,
|
|||
// key
|
||||
//
|
||||
|
||||
std::tuple<ircd::m::dbs::ref, ircd::m::event::idx>
|
||||
ircd::m::dbs::event_refs_tuple
|
||||
ircd::m::dbs::event_refs_key(const string_view &amalgam)
|
||||
{
|
||||
const event::idx key
|
||||
|
|
|
@ -174,7 +174,7 @@ ircd::m::dbs::_index_event_sender(db::txn &txn,
|
|||
|
||||
// sender_key
|
||||
|
||||
std::tuple<ircd::m::event::idx>
|
||||
ircd::m::dbs::event_sender_tuple
|
||||
ircd::m::dbs::event_sender_key(const string_view &amalgam)
|
||||
{
|
||||
const auto &parts
|
||||
|
@ -217,7 +217,7 @@ ircd::m::dbs::is_event_sender_key(const string_view &key)
|
|||
|
||||
// sender_origin_key
|
||||
|
||||
std::tuple<ircd::string_view, ircd::m::event::idx>
|
||||
ircd::m::dbs::event_sender_origin_tuple
|
||||
ircd::m::dbs::event_sender_origin_key(const string_view &amalgam)
|
||||
{
|
||||
const auto &parts
|
||||
|
|
|
@ -135,7 +135,7 @@ ircd::m::dbs::_index_event_type(db::txn &txn,
|
|||
// key
|
||||
//
|
||||
|
||||
std::tuple<ircd::m::event::idx>
|
||||
ircd::m::dbs::event_type_tuple
|
||||
ircd::m::dbs::event_type_key(const string_view &amalgam)
|
||||
{
|
||||
assert(size(amalgam) == sizeof(event::idx) + 1);
|
||||
|
|
|
@ -267,7 +267,7 @@ ircd::m::dbs::room_events__cmp_lt(const string_view &a,
|
|||
// key
|
||||
//
|
||||
|
||||
std::tuple<uint64_t, ircd::m::event::idx>
|
||||
ircd::m::dbs::room_events_tuple
|
||||
ircd::m::dbs::room_events_key(const string_view &amalgam)
|
||||
{
|
||||
assert(size(amalgam) >= 1 + 8 + 8 || size(amalgam) == 1 + 8);
|
||||
|
|
|
@ -218,7 +218,7 @@ ircd::m::dbs::_index_room_joined(db::txn &txn,
|
|||
// key
|
||||
//
|
||||
|
||||
std::tuple<ircd::string_view, ircd::string_view>
|
||||
ircd::m::dbs::room_joined_tuple
|
||||
ircd::m::dbs::room_joined_key(const string_view &amalgam)
|
||||
{
|
||||
const auto &key
|
||||
|
|
|
@ -230,7 +230,7 @@ ircd::m::dbs::room_state_key(const mutable_buffer &out_,
|
|||
return { data(out_), data(out) };
|
||||
}
|
||||
|
||||
std::tuple<ircd::string_view, ircd::string_view>
|
||||
ircd::m::dbs::room_state_tuple
|
||||
ircd::m::dbs::room_state_key(const string_view &amalgam)
|
||||
{
|
||||
const auto &key
|
||||
|
|
|
@ -264,7 +264,7 @@ ircd::m::dbs::room_state_space__cmp_lt(const string_view &a,
|
|||
// key
|
||||
//
|
||||
|
||||
ircd::m::dbs::room_state_space_key_parts
|
||||
ircd::m::dbs::room_state_space_tuple
|
||||
ircd::m::dbs::room_state_space_key(const string_view &amalgam)
|
||||
{
|
||||
const auto &key
|
||||
|
|
Loading…
Reference in a new issue