Skip to main content

icydb_model/base/types/
ident.rs

1//! Module: base::types::ident
2//!
3//! Responsibility: base domain type declarations.
4//! Does not own: runtime storage, query execution, or validator implementation internals.
5//! Boundary: declares macro-modeled domain wrappers and records for downstream schemas.
6
7use crate::prelude::*;
8
9///
10/// Constant
11///
12
13#[newtype(
14    primitive = "Text",
15    item(prim = "Text", unbounded),
16    ty(
17        rule(name = "length", kind = "length_range_inclusive", args(1, 40)),
18        validator(path = "base::validator::text::case::UpperSnake"),
19    )
20)]
21pub struct Constant {}
22
23///
24/// Field
25///
26
27#[newtype(
28    primitive = "Text",
29    item(prim = "Text", unbounded),
30    ty(
31        rule(name = "length", kind = "length_range_inclusive", args(2, 40)),
32        validator(path = "base::validator::text::case::Snake"),
33    )
34)]
35pub struct Field {}
36
37///
38/// Function
39///
40/// 30 characters, snake_case
41///
42
43#[newtype(
44    primitive = "Text",
45    item(prim = "Text", unbounded),
46    ty(
47        rule(name = "length", kind = "length_range_inclusive", args(2, 64)),
48        validator(path = "base::validator::text::case::Snake"),
49    )
50)]
51pub struct Function {}
52
53///
54/// Variable
55///
56
57#[newtype(
58    primitive = "Text",
59    item(prim = "Text", unbounded),
60    ty(
61        rule(name = "length", kind = "length_range_inclusive", args(2, 40)),
62        validator(path = "base::validator::text::case::Snake"),
63    )
64)]
65pub struct Variable {}
66
67///
68/// Variant
69///
70
71#[newtype(
72    primitive = "Text",
73    item(prim = "Text", unbounded),
74    ty(
75        rule(name = "length", kind = "length_range_inclusive", args(1, 40)),
76        validator(path = "base::validator::text::case::UpperCamel"),
77    )
78)]
79pub struct Variant {}