schema-parser
Parses XML schema files into the vendor-agnostic DatabaseModel using roxmltree. Re-exports the XSD schema definition for validation.
Usage
Parse an XML schema file:
use parse_database_xml;
use fs;
let xml = read_to_string?;
let database_model = parse_database_xml?;
// Access schemas, tables, columns, etc. via the model
for schema in database_model.schemas
XML Schema Format
Supported XML elements include tables, columns, keys, indexes, relations (foreign keys), views, functions, procedures, triggers, enums, and initial data. For the complete XSD definition, see SCHEMA_XSD exported from this crate:
use SCHEMA_XSD;
println!;
A minimal example:
Dependencies
roxmltree: XML parsingschema-model: Core data structuresschema-xsd: XSD schema definition (re-exported)
Part of schema-rs
See the workspace README for an overview of the full schema-rs toolchain.