icydb_core/db/query/plan/
model_builder.rs1use crate::db::query::plan::{DeleteSpec, FieldSlot, GroupedExecutionConfig, LoadSpec};
7
8impl LoadSpec {
9 #[must_use]
11 pub const fn new() -> Self {
12 Self {
13 limit: None,
14 offset: 0,
15 }
16 }
17}
18
19impl DeleteSpec {
20 #[must_use]
22 pub const fn new() -> Self {
23 Self {
24 limit: None,
25 offset: 0,
26 }
27 }
28}
29
30impl FieldSlot {
31 #[cfg(test)]
33 #[must_use]
34 pub(in crate::db) fn from_test_slot(index: usize, field: impl Into<String>) -> Self {
35 Self::unresolved(index, field)
36 }
37}
38
39impl GroupedExecutionConfig {
40 #[must_use]
42 pub(in crate::db) const fn with_hard_limits(max_groups: u64, max_group_bytes: u64) -> Self {
43 Self {
44 max_groups,
45 max_group_bytes,
46 }
47 }
48
49 #[must_use]
51 pub(in crate::db) const fn unbounded() -> Self {
52 Self::with_hard_limits(u64::MAX, u64::MAX)
53 }
54
55 #[must_use]
57 pub(in crate::db) const fn max_groups(&self) -> u64 {
58 self.max_groups
59 }
60
61 #[must_use]
63 pub(in crate::db) const fn max_group_bytes(&self) -> u64 {
64 self.max_group_bytes
65 }
66}
67
68impl Default for GroupedExecutionConfig {
69 fn default() -> Self {
70 Self::unbounded()
71 }
72}