News for hackers. Stuff that matters.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by capnorange on Thursday September 03, 2020 @09:13AM (#24363689)
still yet to find an ActiveRecord equivalent for javascript.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by stephen on Thursday September 03, 2020 @09:46AM (#24363975)
I'm trying to build that:

https://github.com/stephenh/joist-ts/

Disclaimer docs aren't amazing yet, so looking through the examples/integration tests are the best way to see how it works.

Prisma has a few mentions in this thread; joist's differentiator is that it leans more "domain model" i.e. validation rules, derived values, and business-logic-y things being in the model.

Which is not for everyone (i.e. the ORM-less approach of the OP/kiss-orm is fine too), but if you're looking for that sort of thing...

Joist also has a novel approach for modeling the lazy-initialized collections/references of ORMs, which is historically tricky in Node/JS/TS. In Joist, all collections/references require `await` to access by default, but that gets tedious very quickly, so you can use populate hints to get a now-synchronously-accessible sub-view of the object graph.

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by racedude on Thursday September 03, 2020 @09:19AM (#24363744)
What about this? https://github.com/typeorm/typeorm/blob/master/docs/active-r... (Forgive me if this isn't what you are looking for, not super familiar with ActiveRecord myself, just recalled seeing that yesterday!
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by Thomaschaaf on Thursday September 03, 2020 @12:50PM (#24365977)
https://mikro-orm.io/ is a much better typeorm alternative as it is actively being maintained. TypeORMs development has come to a halt. And many issues are not being fixed.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by benatkin on Thursday September 03, 2020 @11:58AM (#24365342)
I like TypeORM but have passed on it for now because of this potential sql injection issue: https://github.com/typeorm/typeorm/issues/3740 I have passed a field to order_by() from the user in Django before. I would be more likely to use a dict now, but I shudder at the thought of accidentally creating an SQL injection bug because I expected to be protected by my ORM.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by jdauriemma on Thursday September 03, 2020 @09:39AM (#24363905)
Yes, TypeORM is definitely the JavaScript answer to ActiveRecord
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by agustif on Thursday September 03, 2020 @09:48AM (#24363994)
Can vouch for TypeORM, hopefully it's creator will pick it back up soon and get it to a stable v1.0.0!!
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by midrus on Thursday September 03, 2020 @09:30AM (#24363834)
That's Prisma [1] for me. Coming from Django, I've found prisma even better than the Django ORM, despite not yet as complete.

[1] https://www.prisma.io/docs/understand-prisma/why-prisma

Re:Show HN: ORM for TypeScript with no query-builder, suppor... by anaxag0ras on Thursday September 03, 2020 @10:26AM (#24364386)
This. I haven't tried anything complex but so far Prisma 2 has just been amazing. The API is just so clean and simple.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by cargoshipit on Thursday September 03, 2020 @09:33AM (#24363859)
This bills itself as 'ActiveRecord for Javascript'. Kinda relies on Graphiti's implementation of the JSON API spec. I really like Graphiti and Spraypaint though.
Re:Show HN: ORM for TypeScript with no query-builder, suppor... by cargoshipit on Thursday September 03, 2020 @09:34AM (#24363864)
Sorry got ahead of myself there:

https://www.graphiti.dev/js/