2 releases
Uses new Rust 2024
new 0.1.1 | Apr 19, 2025 |
---|---|
0.1.0 | Apr 17, 2025 |
#1318 in Database interfaces
107 downloads per month
34KB
879 lines
Prisma Rust Schema
A re-export of the Prisma TypeScript types in Rust.
Prisma Rust Schema
Usage
Binary
- 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;
Library
This crate exports the internal TypeScript types from prisma/prisma
.
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