News for hackers. Stuff that matters.
Re:Show HN: Remult – a CRUD framework for full-stack TypeScript by EarthLaunch on Sunday May 22, 2022 @08:45PM (#31474281)
I was stumped on how to integrate Postgres schemas + TypeScript types, so I visited HN, and this thread helped me move forward.

My project is a game, the client/server uses WebSocket rather than a normal REST API.

I have used Prisma, Knex, TypeORM. Seems to me that ideally, we would write types in TypeScript and have a DB schema generated from those, including automatic migrations based on schema diffing like Prisma. Then we only need to know TS, not another DSL.

We don't want to generate TS types from the DB because then we have no way of versioning the DB schema (except by writing SQL or DSL migrations).

I ended up finding https://deepkit.io/library/orm and I'm going to try it out. (Not associated with project)

Re:Show HN: Remult – a CRUD framework for full-stack TypeScript by johnny22 on Sunday May 22, 2022 @09:54PM (#31474630)
are you familiar with mikro-orm ?
Re:Show HN: Remult – a CRUD framework for full-stack TypeScript by EarthLaunch on Sunday May 22, 2022 @11:57PM (#31475203)
Thank you for mentioning it, that made me take a re-look. I find the schema generator doc[0] hard to digest. But I do like that it uses the 'do one thing well' philosophy. Deepkit allows using just the ORM package, but I appreciate how detailed the warnings are on the mikroorm doc.

0: https://mikro-orm.io/docs/schema-generator