Skip to main content

load_schema

Function load_schema 

Source
pub fn load_schema(path: &Path) -> Result<VaultSchema>
Expand description

Load schema from a file.

Errors are mapped to VaultdbError::SchemaError with a human-readable reason — the underlying YAML parser is an implementation detail and is deliberately not exposed in the public error type, so consumers don’t transitively depend on whichever YAML crate vaultdb chooses today.

After parsing, every field’s default and default_expr is validated:

  • default_expr must be one of DEFAULT_EXPRS.
  • default literals must be compatible with field_type.
  • default literals must satisfy enum_values when both are set.
  • default and default_expr are mutually exclusive.