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    item(prim = "Text", unbounded),
15    ty(
16        rule(name = "length", length_range_inclusive(min = 1, max = 40)),
17        validator(path = "base::validator::text::case::UpperSnake"),
18    )
19)]
20pub struct Constant {}
21
22///
23/// Field
24///
25
26#[newtype(
27    item(prim = "Text", unbounded),
28    ty(
29        rule(name = "length", length_range_inclusive(min = 2, max = 40)),
30        validator(path = "base::validator::text::case::Snake"),
31    )
32)]
33pub struct Field {}
34
35///
36/// Function
37///
38/// 30 characters, snake_case
39///
40
41#[newtype(
42    item(prim = "Text", unbounded),
43    ty(
44        rule(name = "length", length_range_inclusive(min = 2, max = 64)),
45        validator(path = "base::validator::text::case::Snake"),
46    )
47)]
48pub struct Function {}
49
50///
51/// Variable
52///
53
54#[newtype(
55    item(prim = "Text", unbounded),
56    ty(
57        rule(name = "length", length_range_inclusive(min = 2, max = 40)),
58        validator(path = "base::validator::text::case::Snake"),
59    )
60)]
61pub struct Variable {}
62
63///
64/// Variant
65///
66
67#[newtype(
68    item(prim = "Text", unbounded),
69    ty(
70        rule(name = "length", length_range_inclusive(min = 1, max = 40)),
71        validator(path = "base::validator::text::case::UpperCamel"),
72    )
73)]
74pub struct Variant {}