Expand description
USEFUL LINKS
This crate on crates.io
Documentation on docs.rs
PURPOSE
The parser uses the Pest library to define grammar rules that interpret specific .yaml structures. It parses:
- Schema name
- Tables within the schema
- Columns their types and modes within each table
The parsed data can be used to generate structured representation of database schemas for your application. GRAMMAR
- WHITESPACE and NEWLINE Handle whitespace and line breaks for flexibility in formatting.
- file Represents the entire schema file, containing a schema definition.
- schema_section Defines the overall structure of the schema, including tables.
- schema_entry Defines the name of the schema and the list of tables.
- table_section Contains one or more table definitions (table_entry).
- table_entry Defines a table with a name and its columns.
- column_section Lists one or more column definitions (column_entry).
- column_entry Describes the properties of a single column, including type and mode.
- column_type Specifies the data type for a column.
- column_mode Specifies whether a column is nullable, required, or repeated.
- column_type_value Defines valid data types for columns.
- column_mode_value Defines valid modes for columns.
- identifier Defines valid identifiers for schema, table, and column names.
Structs§
- Column
- Represents a column within a table, including its type and mode.
- Schema
- Represents a database schema containing multiple tables.
- Table
- Represents a table within the schema, containing a list of columns.
- YAML
Parser - The main YAML parser for database schema files. This parser reads and validates YAML files that define a database schema structure, including schema name, tables, and columns.
Enums§
Functions§
- parse_
columns - Parses a
column_sectionfrom the input, returning a list ofColumnstructs. - parse_
schema - Parses a YAML string into a
Schemastructure. - parse_
tables - Parses a
table_sectionfrom the input, returning a list ofTablestructs.