prax-schema

Crates.ioprax-schema
lib.rsprax-schema
version0.5.0
created_at2025-12-20 23:11:44.173484+00
updated_at2026-01-07 18:32:27.254379+00
descriptionSchema parser and AST for the Prax ORM
homepage
repositoryhttps://github.com/pegasusheavy/prax-orm
max_upload_size
id1997082
size642,911
Joseph R. Quinn (quinnjr)

documentation

https://docs.rs/prax-schema

README

prax-schema

Schema definition language parser for Prax ORM.

Overview

prax-schema provides a Prisma-like schema language parser for defining database models, relations, enums, and views.

Features

  • Custom .prax schema files with intuitive syntax
  • AST types for models, fields, relations, enums, views
  • Schema validation and semantic analysis
  • Documentation comments with validation directives
  • GraphQL and async-graphql integration support

Example Schema

model User {
    id        Int      @id @auto
    email     String   @unique
    name      String?
    posts     Post[]
    createdAt DateTime @default(now())
}

model Post {
    id        Int      @id @auto
    title     String
    content   String?
    published Boolean  @default(false)
    author    User     @relation(fields: [authorId], references: [id])
    authorId  Int
}

Usage

use prax_schema::parse_schema;

let schema = parse_schema(r#"
    model User {
        id    Int    @id @auto
        email String @unique
    }
"#)?;

for model in &schema.models {
    println!("Model: {}", model.name);
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 0

cargo fmt