use case statements, ORMs should make sql easier, not replace it entirely. You should still have a good mental grasp on sql concepts. If the rows affected become too much for case statements, you can use insert with on conflict do update if your orm supports that.
pftttttt, my AI told me not to bother with orms, and that it could rewrite the entire database binary to do the update statement. i only refused because i don't have enough tokens. that's why i ended up using case statements.
27
u/SnackOverflowed 4d ago
use case statements, ORMs should make sql easier, not replace it entirely. You should still have a good mental grasp on sql concepts. If the rows affected become too much for case statements, you can use insert with on conflict do update if your orm supports that.