Open dillondotzip opened 1 year ago
As a start, it would be helpful if we could type our Tinybase tables by passing in generated Prisma types as a type parameter to Tinybase’s setTablesSchema function.
Alternatively, an officially-supported Prisma generator which auto-generates Tinybase schemas would be extremely helpful to DRY up types.
Right now, it’s a pain to write a schema twice: once in Prisma, and another time when setting up Tinybase using setSchema
or setTablesSchema
. Getting them to sync up is a pain.
Even if the data doesn’t sync up, having the types sync up with Prisma would be a massive DX improvement.
I am going to focus on schemas in 5.1 and 5.2. Hang in there!
I'd like to have a single prisma schema that can be used with the inside
setTablesSchema()
.An example
schema.primsa
file:Notice the
@unqiue
&@relation
helpers