ruprizzle-parser
Grammar-driven .ruprizzle schema parser with span-preserving diagnostics.
ruprizzle-parser turns a schema.ruprizzle source string into the typed intermediate representation defined in ruprizzle-core. It is built on a PEG grammar (using pest) and produces rich, location-aware errors so that mistakes in a schema are reported at the exact line and column with actionable help text.
Responsibilities
- Schema parsing — parse
datasource,generator,model,enum, and relation declarations. - Lowering — convert the raw AST into the canonical
ir::Schemaused by the rest of the ORM. - Validation — enforce rules such as unique model names, valid relation arity, and supported native types.
- Error reporting — emit structured, multi-error diagnostics with source spans and suggestions.
Example
use parse;
let source = r#"
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
}
"#;
let schema = parse.expect;
Most users do not call the parser directly; the ruprizzle-cli and code generator handle this for you.
Keywords
orm, sql, database, parser, schema