An auto-generated and type-safe query builder in rust for Prisma
-
Create a valid prisma schema file
prisma/schema.prisma
in your project root i.e. the newly created folderprisma
and yoursrc
folder should be siblings. -
Update your dependencies in the
Cargo.toml
file to includeprisma-client-rs
andserde
.[dependencies] ... prisma-client = { git = "https://github.com/polytope-labs/prisma-client-rs", branch = "master" } serde = { version = "1.0", features = ["serde_derive"] }
-
Create the
.cargo/config.toml
in your project root and add the following:[env] PRISMA_SCHEMA=ABSOLUTE/PATH/TO/SCHEMA/FILE/HERE
-
Go through the example in the
example
folder to see how to use the client.