1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
use std::fmt::{Display, Formatter};
#[expect(unused)]
pub(crate) trait Categorise {
/// Returns the category of the key for error reporting
fn categorise(&self) -> Category;
}
#[derive(Debug, Copy, Clone)]
#[expect(unused)]
pub enum Category {
/// crate::key::storage::version /sv
Version,
/// crate::key::root::all /
Root,
/// crate::key::root::access::ac /!ac{ac}
Access,
/// crate::key::root::access::all /*{ac}
AccessRoot,
/// crate::key::root::access::gr /*{ac}!gr{gr}
AccessGrant,
/// crate::key::root::nd /!nd{nd}
Node,
/// crate::key::root::nb /!nb
NamespaceIdentifierBatch,
/// crate::key::root::ni /!ni
NamespaceIdentifierState,
/// crate::key::root::ns /!ns{ns}
Namespace,
/// crate::key::root::us /!us{us}
User,
/// crate::key::root::tl /!tl{tl}
TaskLease,
/// crate::key::root::cg /!cg{ty}
RootConfig,
/// crate::key::root::ic /!ic{ns}{db}{tb}{ix}{nid}{uuid}
IndexCompaction,
/// crate::key::root::rc /!rc{kind}{ns}{db}{tb}{ix}{expunge}{uuid}
Reclaim,
/// crate::key::root::eq /!eq{ns}{db}{tb}{ev}{ts}{nid}
EventQueue,
///
/// ------------------------------
///
/// crate::key::node::all /${nd}
NodeRoot,
/// crate::key::node::lq /${nd}!lq{lq}{ns}{db}
NodeLiveQuery,
///
/// ------------------------------
///
/// crate::key::namespace::dh /+{ns}!dh
DatabaseIdentifierBatch,
/// crate::key::namespace::di /+{ns}!di
DatabaseIdentifierState,
/// crate::key::database::th /*{ns}*{db}!th
DatabaseTableIdentifierBatch,
/// crate::key::database::ti /*{ns}*{db}!ti
DatabaseTableIdentifierState,
/// crate::key::table::ih /*{ns}*{db}*{tb}!ih
TableIndexIdentifierBatch,
/// crate::key::table::is /*{ns}*{db}*{tb}!is
TableIndexIdentifierState,
///
/// ------------------------------
///
/// crate::key::namespace::all /*{ns}
NamespaceRoot,
/// crate::key::namespace::db /*{ns}!db{db}
DatabaseAlias,
/// crate::key::namespace::access::ac /*{ns}!ac{ac}
NamespaceAccess,
/// crate::key::namespace::access::all /*{ns}*{ac}
NamespaceAccessRoot,
/// crate::key::namespace::access::gr /*{ns}*{ac}!gr{gr}
NamespaceAccessGrant,
/// crate::key::namespace::us /*{ns}!us{us}
NamespaceUser,
///
/// ------------------------------
///
/// crate::key::database::all /*{ns}*{db}
DatabaseRoot,
/// crate::key::database::access::ac /*{ns}*{db}!ac{ac}
DatabaseAccess,
/// crate::key::database::access::all /*{ns}*{db}*{ac}
DatabaseAccessRoot,
/// crate::key::database::access::gr /*{ns}*{db}*ac!gr{gr}
DatabaseAccessGrant,
/// crate::key::database::ap /*{ns}*{db}!ap{ap}
DatabaseApi,
/// crate::key::database::az /*{ns}*{db}!az{az}
DatabaseAnalyzer,
/// crate::key::database::bu /*{ns}*{db}!bu{bu}
DatabaseBucket,
/// crate::key::database::fc /*{ns}*{db}!fn{fc}
DatabaseFunction,
/// crate::key::database::ml /*{ns}*{db}!ml{ml}{vn}
DatabaseModel,
/// crate::key::database::pa /*{ns}*{db}!pa{pa}
DatabaseParameter,
/// crate::key::database::tb /*{ns}*{db}!tb{tb}
DatabaseTable,
/// crate::key::database::ts /*{ns}*{db}!ts{ts}
DatabaseTimestamp,
/// crate::key::database::us /*{ns}*{db}!us{us}
DatabaseUser,
/// crate::key::database::vs /*{ns}*{db}!vs
DatabaseVersionstamp,
/// crate::key::database::cg /*{ns}*{db}!cg{ty}
DatabaseConfig,
/// crate::key::database::sq /*{ns}*{db}*sq{sq}
DatabaseSequence,
///
/// ------------------------------
///
/// crate::key::table::all /*{ns}*{db}*{tb}
TableRoot,
/// crate::key::table::ev /*{ns}*{db}*{tb}!ev{ev}
TableEvent,
/// crate::key::table::fd /*{ns}*{db}*{tb}!fd{fd}
TableField,
/// crate::key::table::ft /*{ns}*{db}*{tb}!ft{ft}
TableView, // (ft = foreign table = view)
/// crate::key::table::ix /*{ns}*{db}*{tb}!ix{ix}
IndexDefinition,
/// crate::key::table::lq /*{ns}*{db}*{tb}!lq{lq}
TableLiveQuery,
///
/// ------------------------------
///
/// crate::key::index::all /*{ns}*{db}*{tb}+{ix}
IndexRoot,
/// crate::key::index::bc /*{ns}*{db}*{tb}+{ix}!bc{id}
IndexTermDocList,
/// crate::key::index::bd /*{ns}*{db}*{tb}+{ix}!bd{id}
IndexBTreeNode,
/// crate::key::index::bf /*{ns}*{db}*{tb}+{ix}!bf{id}
IndexTermDocFrequency,
/// crate::key::index::bi /*{ns}*{db}*{tb}+{ix}!bi{id}
IndexDocKeys,
/// crate::key::index::bk /*{ns}*{db}*{tb}+{ix}!bk{id}
IndexTermList,
/// crate::key::index::bo /*{ns}*{db}*{tb}+{ix}!bo{id}
IndexOffset,
/// crate::key::index::bs /*{ns}*{db}*{tb}+{ix}!bs
IndexFullTextState,
/// crate::key::index::bu /*{ns}*{db}*{tb}+{ix}!bu{id}
IndexTerms,
/// crate::key::index::dc /*{ns}*{db}*{tb}+{ix}!dc{id}
IndexFullTextDocCountAndLength,
/// crate::key::index::dl /*{ns}*{db}*{tb}+{ix}!dl{id}
IndexDocLength,
/// crate::key::index::td /*{ns}*{db}*{tb}+{ix}!td{term}{id}
IndexTermDocument,
/// crate::key::index::tt
/// /*{ns}*{db}*{tb}+{ix}!td{term}{uuid}{uuid}
IndexTermDocuments,
/// crate::key::index::he /*{ns}*{db}*{tb}+{ix}!he{id}
IndexHnswElements,
/// crate::key::index::hd /*{ns}*{db}*{tb}+{ix}!hd{id}
IndexHnswDocIds,
/// crate::key::index::hi /*{ns}*{db}*{tb}+{ix}!hi{id}
IndexHnswThings,
/// crate::key::index::hv /*{ns}*{db}*{tb}+{ix}!hv{vec}
IndexHnswVec,
/// crate::key::index::hh /*{ns}*{db}*{tb}+{ix}!hh{hash}
IndexHnswHashedVec,
/// crate::key::index::ia /*{ns}*{db}*{tb}+{ix}!ia{id} (Previously - discarded by
/// #6856) crate::key::index::ig /*{ns}*{db}*{tb}+{ix}!ig{id}
IndexAppendings,
/// crate::key::index::ib /*{ns}*{db}*{tb}+{ix}!ib{id}
IndexInvertedDocIds,
/// crate::key::index::ip /*{ns}*{db}*{tb}+{ix}!ip{id}
IndexPrimaryAppending,
/// crate::key::index::is /*{ns}*{db}*{tb}+{ix}!is{uuid}
IndexFullTextDocIdsSequenceState,
/// crate::key::index::iu /*{ns}*{db}*{tb}+{ix}*iu{uuid}{uuid}{count}
IndexCountState,
/// crate::key::table::bs /*{ns}*{db}*{tb}!bs{ix}
IndexBuildState,
/// crate::key::table::br /*{ns}*{db}*{tb}!br{ix}{generation}{ticket}
IndexBuildReservation,
/// crate::key::table::bg /*{ns}*{db}*{tb}!bg{ix}{generation}{ticket}
IndexBuildAppending,
/// crate::key::table::bp /*{ns}*{db}*{tb}!bp{ix}{generation}{id}
IndexBuildPrimaryAppending,
/// crate::key::index /*{ns}*{db}*{tb}+{ix}*{fd}{id}
Index,
///
/// ------------------------------
///
/// crate::key::change /*{ns}*{db}#{ts}
ChangeFeed,
/// crate::key::lqe /*{ns}*{db}%{ts}
LiveQueryEvent,
///
/// ------------------------------
///
/// crate::key::record /*{ns}*{db}*{tb}*{id}
Record,
///
/// ------------------------------
///
/// crate::key::graph /*{ns}*{db}*{tb}~{id}{eg}{ft}{fk}
Graph,
///
/// ------------------------------
///
/// crate::key::ref /*{ns}*{db}*{tb}&{id}{ft}{ff}{fk}
Ref,
///
/// ------------------------------
///
/// crate::seq::state /*{ns}*{db}!sq{sq}!st{nid}
SequenceState,
/// crate::seq::batch /*{ns}*{db}!sq{sq}!ba{start}
SequenceBatch,
}
impl Display for Category {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match self {
Self::Version => "StorageVersion",
Self::Root => "Root",
Self::Access => "Access",
Self::AccessRoot => "AccessRoot",
Self::AccessGrant => "AccessGrant",
Self::Node => "Node",
Self::NamespaceIdentifierBatch => "NamespaceIdentifierBatch",
Self::NamespaceIdentifierState => "NamespaceIdentifierState",
Self::Namespace => "Namespace",
Self::User => "User",
Self::NodeRoot => "NodeRoot",
Self::NodeLiveQuery => "NodeLiveQuery",
Self::NamespaceRoot => "NamespaceRoot",
Self::DatabaseAlias => "DatabaseAlias",
Self::DatabaseIdentifierBatch => "DatabaseIdentifierBatch",
Self::DatabaseIdentifierState => "DatabaseIdentifierState",
Self::NamespaceAccess => "NamespaceAccess",
Self::NamespaceAccessRoot => "NamespaceAccessRoot",
Self::NamespaceAccessGrant => "NamespaceAccessGrant",
Self::NamespaceUser => "NamespaceUser",
Self::DatabaseRoot => "DatabaseRoot",
Self::DatabaseAccess => "DatabaseAccess",
Self::DatabaseAccessRoot => "DatabaseAccessRoot",
Self::DatabaseAccessGrant => "DatabaseAccessGrant",
Self::DatabaseApi => "DatabaseApi",
Self::DatabaseAnalyzer => "DatabaseAnalyzer",
Self::DatabaseBucket => "DatabaseBucket",
Self::DatabaseFunction => "DatabaseFunction",
Self::DatabaseModel => "DatabaseModel",
Self::DatabaseParameter => "DatabaseParameter",
Self::DatabaseTable => "DatabaseTable",
Self::DatabaseTableIdentifierBatch => "DatabaseTableIdentifierBatch",
Self::DatabaseTableIdentifierState => "DatabaseTableIdentifierState",
Self::DatabaseTimestamp => "DatabaseTimestamp",
Self::DatabaseUser => "DatabaseUser",
Self::DatabaseVersionstamp => "DatabaseVersionstamp",
Self::DatabaseSequence => "DatabaseSequence",
Self::DatabaseConfig => "DatabaseConfig",
Self::TableRoot => "TableRoot",
Self::TableEvent => "TableEvent",
Self::TableField => "TableField",
Self::TableView => "TableView",
Self::IndexDefinition => "IndexDefinition",
Self::TableLiveQuery => "TableLiveQuery",
Self::IndexRoot => "IndexRoot",
Self::IndexTermDocList => "IndexTermDocList",
Self::IndexBTreeNode => "IndexBTreeNode",
Self::IndexTermDocFrequency => "IndexTermDocFrequency",
Self::IndexDocKeys => "IndexDocKeys",
Self::IndexDocLength => "IndexDocLength",
Self::IndexTermDocument => "IndexTermDocument",
Self::IndexTermList => "IndexTermList",
Self::IndexOffset => "IndexOffset",
Self::IndexFullTextState => "IndexFullTextState",
Self::IndexTerms => "IndexTerms",
Self::IndexHnswElements => "IndexHnswElements",
Self::IndexHnswDocIds => "IndexHnswDocIds",
Self::IndexHnswThings => "IndexHnswThings",
Self::IndexHnswVec => "IndexHnswVec",
Self::IndexHnswHashedVec => "IndexHnswHashedVec",
Self::IndexAppendings => "IndexAppendings",
Self::IndexPrimaryAppending => "IndexPrimaryAppending",
Self::Index => "Index",
Self::ChangeFeed => "ChangeFeed",
Self::LiveQueryEvent => "LiveQueryEvent",
Self::Record => "Record",
Self::Graph => "Graph",
Self::Ref => "Ref",
Self::SequenceState => "SequenceState",
Self::SequenceBatch => "SequenceBatch",
Self::TaskLease => "TaskLease",
Self::RootConfig => "RootConfig",
Self::IndexInvertedDocIds => "IndexInvertedDocIds",
Self::IndexFullTextDocIdsSequenceState => "IndexFullTextDocIdsSequenceState",
Self::IndexFullTextDocCountAndLength => "IndexFullTextDocCountAndLength",
Self::IndexTermDocuments => "IndexTermDocuments",
Self::IndexCompaction => "IndexCompaction",
Self::Reclaim => "Reclaim",
Self::IndexCountState => "IndexCountState",
Self::IndexBuildState => "IndexBuildState",
Self::IndexBuildReservation => "IndexBuildReservation",
Self::IndexBuildAppending => "IndexBuildAppending",
Self::IndexBuildPrimaryAppending => "IndexBuildPrimaryAppending",
Self::EventQueue => "EventQueue",
Self::TableIndexIdentifierBatch => "TableIndexIdentifierBatch",
Self::TableIndexIdentifierState => "TableIndexIdentifierState",
};
write!(f, "{}", name)
}
}