Skip to main content

cratestack_parser/
lib.rs

1mod diagnostics;
2mod entry;
3mod line_helpers;
4mod parse;
5mod relation_actions;
6mod relation_helpers;
7mod validate;
8
9#[cfg(test)]
10mod tests_attribute_spacing;
11#[cfg(test)]
12mod tests_basic;
13mod tests_builder_add_setter_collisions;
14#[cfg(test)]
15mod tests_builder_collisions;
16mod tests_builder_collisions_derived;
17#[cfg(test)]
18mod tests_client_method_collisions;
19#[cfg(test)]
20mod tests_computed;
21#[cfg(test)]
22mod tests_computed_params;
23mod tests_computed_type_valued;
24#[cfg(test)]
25mod tests_docs;
26#[cfg(test)]
27mod tests_enums;
28#[cfg(test)]
29mod tests_error_file_identity;
30#[cfg(test)]
31mod tests_extensions;
32#[cfg(test)]
33mod tests_field_attrs;
34#[cfg(test)]
35mod tests_list_arity;
36#[cfg(test)]
37mod tests_mixins;
38#[cfg(test)]
39mod tests_model_attrs;
40#[cfg(test)]
41mod tests_model_index;
42#[cfg(test)]
43mod tests_model_internal;
44#[cfg(test)]
45mod tests_model_unique;
46#[cfg(test)]
47mod tests_multi_error;
48mod tests_patch_touch_flag_collisions;
49#[cfg(test)]
50mod tests_procedure_handler_collisions;
51#[cfg(test)]
52mod tests_procedures;
53#[cfg(test)]
54mod tests_queries;
55#[cfg(test)]
56mod tests_queries_attributes;
57#[cfg(test)]
58mod tests_queries_rejections;
59#[cfg(test)]
60mod tests_queries_sql_body;
61#[cfg(test)]
62mod tests_queries_support;
63#[cfg(test)]
64mod tests_relation_actions;
65#[cfg(test)]
66mod tests_relations;
67#[cfg(test)]
68mod tests_relations_policy;
69#[cfg(test)]
70mod tests_reserved_keywords;
71#[cfg(test)]
72mod tests_snake_case_collisions;
73#[cfg(test)]
74mod tests_spatial;
75#[cfg(test)]
76mod tests_stream_attribute;
77#[cfg(test)]
78mod tests_transport;
79#[cfg(test)]
80mod tests_type_declaration_collisions;
81#[cfg(test)]
82mod tests_types;
83#[cfg(test)]
84mod tests_validators;
85#[cfg(test)]
86mod tests_vector;
87#[cfg(test)]
88mod tests_version;
89#[cfg(test)]
90mod tests_views;
91
92pub use diagnostics::SchemaError;
93pub use entry::{
94    ANONYMOUS_SCHEMA, parse_schema, parse_schema_diagnostics, parse_schema_file,
95    parse_schema_named, parse_schema_unvalidated,
96};
97
98/// Canonical scalar type names built into the `.cstack` language (e.g.
99/// `String`, `Int`, `Decimal`, ...), including `Page` (which is valid only
100/// as a procedure return type — see `validate::type_names::validate_type_ref`
101/// — not as a plain field type).
102///
103/// This is the same list `cratestack-lsp`'s autocompletion and the
104/// `cratestack-pg`/`cratestack-sqlite` emitter/decoder round-trip tests
105/// assert against, so a new builtin scalar only has to be added here once —
106/// see cratestack#232 for why that matters (this list had already silently
107/// drifted from the LSP's hand-copied one before this accessor existed).
108pub fn builtin_type_names() -> &'static [&'static str] {
109    validate::builtin_type_names()
110}
111
112#[cfg(test)]
113use relation_helpers::parse_relation_attribute;