Expand description
Reads the model!{} DSL out of a Rust source file into a ParsedSchema.
The DSL itself is parsed by runique_dsl, the same parser the model!{}
macro uses, so a model the macro refuses is refused here too.
Structs§
- Parsed
Model - A
model!{}read for migrations: its table, and the tables of its list fields (checkbox/multichoice).
Functions§
- parse_
model_ from_ source - Same as
parse_schema_from_source, with the list fields’ tables. - parse_
schema_ from_ source - Parses the
model!{}invocation of a Rust source file and returns the model’s snake_case name together with itsParsedSchema.Ok(None)when the file has nomodel!{}; an error when the file isn’t valid Rust, when the model doesn’t parse, or when the file declares more than one model.