ruprizzle-parser 0.1.0-alpha.1

Schema DSL parser for the ruprizzle ORM
Documentation

schema.ruprizzle parser.

The public surface is deliberately one function, [parse]. Everything else — the Pest grammar, the loose AST, the five lowering passes, the validation rule table — is an implementation detail behind it. That narrowness is what makes replacing the parser a contained change rather than a schedule risk (see the fallback note in ImplPlan02SchemaDslParser.md).

let schema = ruprizzle_parser::parse(
    "schema.ruprizzle",
    r#"
    datasource db {
      provider = "postgres"
      url      = env("DATABASE_URL")
    }

    model User {
      id    Uuid   @id @default(uuid7())
      email String @unique
    }
    "#,
)
.expect("valid schema");

assert_eq!(schema.model("User").unwrap().table, "users");

Errors accumulate: one call reports every problem it can find, each with a span and a suggested fix.