Skip to main content

Module model

Module model 

Source
Expand description

Generates per-model Rust modules (struct, filters, data inputs, ordering, CRUD).

For each model in the schema, this module produces:

  • A data struct (e.g., User) with sqlx::FromRow and serde derives.
  • A filter submodule with WhereInput and WhereUniqueInput types.
  • A data submodule with CreateInput and UpdateInput types.
  • An order submodule with OrderByInput.
  • An Actions struct exposing create, find_unique, find_many, update, delete, upsert, and batch operations.
  • Query builder structs that chain filters, ordering, pagination, and include clauses before calling .exec().

Functionsยง

generate_model_module
Generate the complete module for a single model.