Help with schema #160
-
Hi, not strictly related to the rust client, but prisma directly. Basically I have many "stores", and each store can house a bunch of products, each with it's own attributes. There are a ton of products, so I can't just make a new table for each product type. This is how I'm writing it in rust struct Store {
name: String,
location: String,
products: Vec<Product>
}
enum Product {
Shirt(Shirt),
Wallet(Wallet)
}
struct Shirt {
size: String
}
struct Wallet {
material: String
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'd like to keep these discussions Rust-related only, since the Prisma discussions are a much better place for questions like this, so I'd suggest seeing what they say over there. |
Beta Was this translation helpful? Give feedback.
I'd like to keep these discussions Rust-related only, since the Prisma discussions are a much better place for questions like this, so I'd suggest seeing what they say over there.
Though IMO if you've got a dynamic collection of products, you'll need to just store JSON or some other data format in a single Product table and enforce types at the Rust-level.