carp
carp copied to clipboard
Rust enum information lost when generating Typescript
When defining our database schema, we made enums (such as the block era) be represented at the database level by plain ints. The problem with this is that later on when we use Prisma to generate the Typescript type definition, it means they end up being represented in Typescript as just plain number which is not typesafe and also hurts readability.
I'm not sure if Prisma supports SQL enums, but it's something to investigate
just commenting because I've used Prisma before, it does seem like Prisma supports enums depending on which db
https://www.prisma.io/docs/reference/database-reference/database-features#misc
Probably we won't be using Prisma since in the end I don't think it supports the features we need.
@SebastienGllmt I'm curious to what features you're saying don't exist in Prisma and what alternative client you would use that does cover those features?
@CyberCyclone I want typed raw SQL, not an ORM. This is provided by pgtyped