1 unstable release
Uses new Rust 2024
new 0.1.0 | Apr 17, 2025 |
---|
#452 in Database interfaces
45KB
957 lines
Prisma Rust Schema
Usage
- Install the binary
cargo install prisma-rust-schema
- Add the generator config to your
.prisma
file:
generator prisma_rust_schema {
provider = "prisma-rust-schema"
output = "./src/prisma"
}
- Run the generator
npx prisma generate
- Use the generated code in your Rust project:
use prisma::MyModel;
Constraints
Currently, all enums and structs generated have #[derive(Serialize, Deserialize, Debug)]
and #[serde(rename_all = "camelCase")]
attributes. In future versions, this will be configurable.
Development
npx prisma generate
Dependencies
~0.7–1.6MB
~35K SLoC