Skip to main content

parse_rust_schema/
lib.rs

1//! Field types, inference, validation, and the `_SCHEMA` storage format.
2//!
3//! Parse's schema is *implicit*: the first write that mentions a field decides its type, and every
4//! later write is checked against that decision. This crate owns that machinery. It performs no
5//! I/O; loading and persisting a schema belongs to the storage adapter.
6//!
7//! `storage_format` is the highest-risk module in the crate, because `_SCHEMA` is shared with any
8//! parse-server reading the same database and both of its failure modes are silent.
9
10#![forbid(unsafe_code)]
11#![cfg_attr(
12    not(test),
13    deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
14)]
15
16pub mod clp_validate;
17pub mod controller;
18pub mod infer;
19pub mod schema_api;
20pub mod storage_format;
21
22pub use clp_validate::{validate_clp, ClpValidation, ObjectIdForm, Unenforceable};
23pub use controller::{
24    apply, default_schema, validate_required_columns, validate_write, validate_write_fields,
25    SchemaDelta,
26};
27pub use infer::{
28    class_name_is_valid, field_name_is_valid, infer_op_type, infer_type, SYSTEM_CLASSES,
29    VOLATILE_CLASSES,
30};
31pub use parse_rust_storage::{ClassSchema, FieldType};
32pub use schema_api::{
33    check_default_value_type, plan_update, validate_new_class, FieldChange, SchemaMutation,
34    SetField,
35};