Skip to main content

icydb_schema/
bounds.rs

1//! Frozen bounds for the current proposal transport.
2
3/// Maximum encoded size of one reusable schema fragment.
4pub const MAX_SCHEMA_FRAGMENT_BYTES: usize = 512 * 1024;
5
6/// Maximum encoded size of one database-scoped schema proposal.
7pub const MAX_SCHEMA_PROPOSAL_BYTES: usize = 2 * 1024 * 1024;
8
9/// Maximum encoded size of one coordinated source migration plan.
10pub const MAX_SCHEMA_MIGRATION_PLAN_BYTES: usize = 512 * 1024;
11
12/// Maximum byte length of one typed current-name proposal key.
13pub const MAX_SOURCE_KEY_BYTES: usize = 128;
14
15/// Maximum byte length of one current schema name.
16pub const MAX_SCHEMA_NAME_BYTES: usize = MAX_SOURCE_KEY_BYTES;
17
18/// Maximum byte length of one caller-generated submission key.
19pub const MAX_SCHEMA_SUBMISSION_KEY_BYTES: usize = 128;
20
21/// Maximum byte length of one text or blob proposal literal.
22pub const MAX_PROPOSAL_LITERAL_BYTES: usize = 64 * 1024;
23
24/// Default maximum canonical encoding for unbounded authored big integers.
25pub const DEFAULT_BIG_INT_MAX_BYTES: u32 = 256;
26
27/// Maximum number of reusable fragments in one proposal.
28pub const MAX_SCHEMA_PROPOSAL_FRAGMENTS: usize = 1_024;
29
30/// Maximum number of entity definitions in one fragment.
31pub const MAX_FRAGMENT_ENTITIES: usize = 1_024;
32
33/// Maximum number of named type definitions in one fragment.
34pub const MAX_FRAGMENT_TYPES: usize = 1_024;
35
36/// Maximum number of fields in one entity or record definition.
37pub const MAX_FRAGMENT_FIELDS: usize = 256;
38
39/// Maximum number of indexes in one entity definition.
40pub const MAX_FRAGMENT_INDEXES: usize = 64;
41
42/// Maximum number of relations in one entity definition.
43pub const MAX_FRAGMENT_RELATIONS: usize = 64;
44
45/// Maximum number of deterministic steps in one nested relation source path.
46pub const MAX_RELATION_PATH_STEPS: usize = MAX_SCHEMA_FIELD_TYPE_DEPTH;
47
48/// Maximum number of accepted constraints in one entity definition.
49pub const MAX_FRAGMENT_CONSTRAINTS: usize = 256;
50
51/// Maximum number of instructions in one source-level check expression.
52pub const MAX_SOURCE_CHECK_INSTRUCTIONS: usize = 1_024;
53
54/// Maximum inline nesting depth of one field-type contract.
55///
56/// Named references terminate inline traversal. The separately bounded named
57/// type catalog may contain resolved cycles without recursively expanding
58/// their definitions.
59pub const MAX_SCHEMA_FIELD_TYPE_DEPTH: usize = 64;
60
61/// Maximum number of explicit removals in one proposal.
62pub const MAX_SCHEMA_REMOVALS: usize = 4_096;
63
64/// Maximum number of entity-to-store assignments in one proposal.
65pub const MAX_SCHEMA_ASSIGNMENTS: usize = 4_096;
66
67/// Maximum number of required capabilities in one proposal.
68pub const MAX_SCHEMA_CAPABILITIES: usize = 32;
69
70/// Maximum number of entity transitions in one coordinated migration plan.
71pub const MAX_SCHEMA_MIGRATION_ENTITIES: usize = MAX_SCHEMA_ASSIGNMENTS;
72
73/// Maximum number of explicit rename operations for one entity transition.
74pub const MAX_SCHEMA_MIGRATION_RENAMES: usize = MAX_SCHEMA_ASSIGNMENTS;
75
76/// Maximum number of explicit transforms for one entity transition.
77pub const MAX_SCHEMA_MIGRATION_TRANSFORMS: usize = MAX_SCHEMA_ASSIGNMENTS;