Database Design for API

How would you guys go about designing a table/api for something like a form builder for a specific purpose. For example I want the users to be able to add inputs etc, and right now I just save these as json in a json column for each form type created by a user, however when it comes to types, this isn't so convenient. So I was thinking of possibly just making the form inputs to be stored as a list of json, where each input would have { name:"", Value:"", Type:"", Validation:"" } and then just parsing the json array into a form and to store it's values. Almost like EAV style, but per a row since we have json columns now
1 Reply
Max
Max2y ago
Thats how I would go about that using prisma (maybe someone else will have a cool idea), maybe look into superjson aswell? Not sure if it fits your use case, but could be helpful.
Want results from more Discord servers?
Add your server