3 ms·
That is great and I noticed it’s something I have always assumed should be the case - no indirect access to the database outside your application / ORM. Because
by shayonj 3y ago
That is great and I noticed it’s something I have always assumed should be the case - no indirect access to the database outside your application / ORM. Because then you open a can of worms.
- out_of_protocol 3y agoDoesn't help much though. It only takes not wrapping related inserts into transaction in one place in your code. i know zero frameworks/ORMs that can help you with that
- tacone 3y agoI usually wrap everything (including reads) in a transaction at middleware level. Not perfect, has its downsides but for many projects it's perfectly ok. Of course it's not a real substitute for foreign keys, but definitely better than nothing.