6 ms·
My feelings are similar and I cringe every time I see a "typesafe" db interface that doesn't run time validate the data.
by plopz 2y ago
My feelings are similar and I cringe every time I see a "typesafe" db interface that doesn't run time validate the data.
- lerp-io 2y agotypescript people want types on everything cuz it feels good that way.
- nikisweeting 2y agoAlso it allows AI tools in IDEs like Cursor to work a lot more effectivley because they can leverage type/lint errors to make sure suggestions are correct on the first try.
- jadbox 2y agoWhat do you use for runtime? I've used pgtyped in the past and it does a good job at taking raw SQL and generating the return types from runtime: https://github.com/adelsz/pgtyped https://github.com/adelsz/pgtyped
- bluepnume 2y agoRuntime validate at the database boundary? Isn't it better to just do runtime validation at the api boundary instead? Then any of the types that make it into the database should be mostly guaranteed by TS (and of course, whatever types are enforced by the database schema itself).
- webda2l 2y agoI created https://github.com/a2lix/schemql https://github.com/a2lix/schemql that maybe could fit your demand.