Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My feelings are similar and I cringe every time I see a "typesafe" db interface that doesn't run time validate the data.


Runtime 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).


What 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


typescript people want types on everything cuz it feels good that way.


Also 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.


I created https://github.com/a2lix/schemql that maybe could fit your demand.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: