#Deciding on DB + transformation + validation solution

1 messages · Page 1 of 1 (latest)

mystic shale
#

I've been mulling this over for the past few days. I'm posting this in the DB section because I think the choice of DB solution does impact things here.

So far, the winning combinations appear to be:

MikroOrm + class-transformer + class validator:
This plays nicely with Nest's tooling and leaves the door open to quickly add code first GraphQL resolvers. However the class packages are slow and somewhat abandoned at this point.

Drizzle or Kysely + zod:
More full stack type safety. But very green projects. I'm also a bit concerned with TS language server performance as the app grows in complexity.

Prisma + zod:
Good DX, but questionably heavy dependency on a Rust engine to power sub-optimal queries

For the non-entity based approach, I'm also curious how I might best leverage DTOs at the controller level.

Are there any other winning combinations I might have missed?

near ether
#

Where did you land on this ? currently looking at Prisma+Zod

mild forge
#

@mystic shale - You're right. class-transformer and class-validator are abandoned. The Nest team had plans to take over development on them for Nest users, but that seemed to be put on back burners for more important things. I'd personally suggest finding something else, which already has a Nest module set up for it.

As for an ORM, that's definitely a tough decision and can only be answered by you/ your team.

As for "the combinations". They really aren't mixed in any way and the better questions would be asked for each realm of responsibility. Validation, Transformation and ORM. For validation, there are a good number of solutions. Transformation, not so much. ORM again, lots of solutions.

Have a look at Typia (if you haven't already) for validation.

eager folio
#

that looks a bit REST exclusive

#

zod you already mentioned effect/schema might be also useful for validation and transformation