Comment

Comment by amluto

A problem that I haven’t seen a good solution to is that most (all?) ORMs are also caches. And once you step outside the object box, cache invalidation is incredibly hard. Taking an example from this post:

    await postRepository
      .createQueryBuilder()
      .update(Post)
      .set({ status: 'archived' })
      .where("authorId IN (SELECT id FROM author WHERE company = :company)", { company: 'Hooli' })
      .execute();
What happens to all the pre-existing Post objects when you do this?

(Maybe some ORMs try to get this right. It’s a very hard problem. Certainly the ORMs I’ve used don’t, but I admit I haven’t used very many.)

parent amluto 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton