News for hackers. Stuff that matters.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by dathinab on Thursday September 03, 2020 @10:00AM (#24364107)
> reliable migrations

My experience is that libraries which do handle that for you automatically do a really bad job at it.

Writing it by hand and most important thoroughly testing it and trying to avoid doing any changes needing complex migrations is in my experience more reliable on the long run.

EDIT: removed inappropriate caps usage

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by midrus on Thursday September 03, 2020 @10:19AM (#24364299)
Tell that to the Django ORM. I've used it in really big projects, for really big companies and it never failed on us.

As I said in another thread, the problem is not writing the SQL. The problem is everything else after you have written it (applying on deploy, automating for other's dev envs, rollback, etc)

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by rubber_duck on Thursday September 03, 2020 @11:50AM (#24365217)
>As I said in another thread, the problem is not writing the SQL. The problem is everything else after you have written it (applying on deploy, automating for other's dev envs, rollback, etc)

What's wrong with migration managers ? They handle all you mentioned just fine. The only problem I've seen with this approach were when working on a team that didn't have proper CI flow, then it was possible for people to check in bad migrations and screw up branches, etc.

I've worked with both approaches in multiple languages, and frankly I prefer the no-magic migration manager approach.

Migrations automatically generated from model also mean your DB is tied to your app, which I'm not a fan of, if anything the reverse should be true, and the fat model approaches of rails are terrible IMO (I haven't used Django for anything serious in over 10 years so I don't remember how fat their model layer is - I know it has enough metadata to generate the admin CRUD but don't remember if it also encourages having logic on models).

The best solution I've seen is F# which uses dynamic type providers (basically compiler plugin) to auto-generate models from DB/schema at compile time, and yesql in clojure (clojure being dynamic and built arround working with data using SQL results inside of it is natural and amazing).