surrealpatch/lib/src/key/mod.rs

98 lines
3.9 KiB
Rust
Raw Normal View History

2023-06-19 18:44:40 +00:00
//! How the keys are structured in the key value store
2023-03-04 10:51:19 +00:00
///
/// KV /
2023-06-20 22:50:26 +00:00
///
/// ND /!nd{nd}
/// LQ /!nd{nd}*{ns}*{db}!lq{lq}
///
/// HB /!hb{ts}/{nd}
///
2022-03-20 14:27:56 +00:00
/// NS /!ns{ns}
///
2022-03-20 14:27:56 +00:00
/// Namespace /*{ns}
/// NL /*{ns}!nl{us}
/// NT /*{ns}!nt{tk}
/// DB /*{ns}!db{db}
///
2022-03-20 14:27:56 +00:00
/// Database /*{ns}*{db}
2023-05-10 02:08:09 +00:00
/// AZ /*{ns}*{db}!az{az}
/// CF /*{ns}*{db}!cf{ts}
2022-03-20 14:27:56 +00:00
/// DL /*{ns}*{db}!dl{us}
/// DT /*{ns}*{db}!dt{tk}
/// PA /*{ns}*{db}!pa{pa}
2023-03-04 10:51:19 +00:00
/// SC /*{ns}*{db}!sc{sc}
2022-03-20 14:27:56 +00:00
/// TB /*{ns}*{db}!tb{tb}
///
/// Scope /*{ns}*{db}±{sc}
/// ST /*{ns}*{db}±{sc}!st{tk}
///
/// AZ /*{ns}*{db}!az{az}
///
2022-03-20 14:27:56 +00:00
/// Table /*{ns}*{db}*{tb}
/// EV /*{ns}*{db}*{tb}!ev{ev}
2023-03-04 10:51:19 +00:00
/// FD /*{ns}*{db}*{tb}!fd{fd}
/// FT /*{ns}*{db}*{tb}!ft{ft}
2022-03-20 14:27:56 +00:00
/// IX /*{ns}*{db}*{tb}!ix{ix}
/// LV /*{ns}*{db}*{tb}!lv{lv}
///
2022-03-20 14:27:56 +00:00
/// Thing /*{ns}*{db}*{tb}*{id}
///
2022-06-15 07:41:23 +00:00
/// Graph /*{ns}*{db}*{tb}~{id}{eg}{fk}
2022-03-20 14:27:56 +00:00
///
2022-06-15 07:41:23 +00:00
/// Index /*{ns}*{db}*{tb}¤{ix}{fd}{id}
///
/// BC /*{ns}*{db}*{tb}!bc{ix}*{id}
/// BD /*{ns}*{db}*{tb}!bd{ix}*{id}
/// BF /*{ns}*{db}*{tb}!bf{ix}*{id}
/// BI /*{ns}*{db}*{tb}!bi{ix}*{id}
/// BK /*{ns}*{db}*{tb}!bk{ix}*{id}
/// BL /*{ns}*{db}*{tb}!bl{ix}*{id}
/// BP /*{ns}*{db}*{tb}!bp{ix}*{id}
/// BS /*{ns}*{db}*{tb}!bs{ix}
/// BT /*{ns}*{db}*{tb}!bt{ix}*{id}
/// BU /*{ns}*{db}*{tb}!bu{ix}*{id}
2023-05-10 02:08:09 +00:00
pub mod az; // Stores a DEFINE ANALYZER config definition
pub mod bc; // Stores Doc list for each term
pub mod bd; // Stores BTree nodes for doc ids
pub mod bf; // Stores Term/Doc frequency
pub mod bi; // Stores doc keys for doc_ids
pub mod bk; // Stores the term list for doc_ids
pub mod bl; // Stores BTree nodes for doc lengths
2023-06-21 18:31:15 +00:00
pub mod bo; // Stores the offsets
pub mod bp; // Stores BTree nodes for postings
pub mod bs; // Stores FullText index states
pub mod bt; // Stores BTree nodes for terms
pub mod bu; // Stores terms for term_ids
pub mod cf; // Stores change feeds
2023-06-20 22:50:26 +00:00
pub mod cl; // Stores cluster membership information
pub mod database; // Stores the key prefix for all keys under a database
pub mod db; // Stores a DEFINE DATABASE config definition
pub mod dl; // Stores a DEFINE LOGIN ON DATABASE config definition
pub mod dt; // Stores a DEFINE LOGIN ON DATABASE config definition
pub mod dv; // Stores database versionstamps
pub mod ev; // Stores a DEFINE EVENT config definition
pub mod fc; // Stores a DEFINE FUNCTION config definition
pub mod fd; // Stores a DEFINE FIELD config definition
pub mod ft; // Stores a DEFINE TABLE AS config definition
pub mod graph; // Stores a graph edge pointer
2023-06-20 22:50:26 +00:00
pub mod hb; // Stores a heartbeat per registered cluster node
pub mod index; // Stores an index entry
pub mod ix; // Stores a DEFINE INDEX config definition
pub mod kv; // Stores the key prefix for all keys
pub mod lq; // Stores a LIVE SELECT query definition on the database
pub mod lv; // Stores a LIVE SELECT query definition on the table
pub mod namespace; // Stores the key prefix for all keys under a namespace
pub mod nl; // Stores a DEFINE LOGIN ON NAMESPACE config definition
pub mod ns; // Stores a DEFINE NAMESPACE config definition
pub mod nt; // Stores a DEFINE TOKEN ON NAMESPACE config definition
pub mod pa; // Stores a DEFINE PARAM config definition
pub mod sc; // Stores a DEFINE SCOPE config definition
pub mod scope; // Stores the key prefix for all keys under a scope
pub mod st; // Stores a DEFINE TOKEN ON SCOPE config definition
pub mod table; // Stores the key prefix for all keys under a table
pub mod tb; // Stores a DEFINE TABLE config definition
pub mod thing;
const CHAR_PATH: u8 = 0xb1; // ±
const CHAR_INDEX: u8 = 0xa4; // ¤