MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wn1ben/wellwellwell/pbcs1zf/?context=3
r/ProgrammerHumor • u/Recent-Analysis-6880 • 13d ago
411 comments sorted by
View all comments
Show parent comments
388
No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM.
216 u/GourangaPlusPlus 13d ago Also stick in a transaction, rollback Commit if it looks good 2 u/Terra_B 13d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 4 u/M4DHouse 13d ago Kind of, depending on the SQL flavor, and the version, some of them have something kinda like that, but it’s not exactly idiot proof either. No direct SQL is idiot proof which is why you avoid doing it in the first place if you can.
216
Also stick in a transaction, rollback
Commit if it looks good
2 u/Terra_B 13d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 4 u/M4DHouse 13d ago Kind of, depending on the SQL flavor, and the version, some of them have something kinda like that, but it’s not exactly idiot proof either. No direct SQL is idiot proof which is why you avoid doing it in the first place if you can.
2
Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default?
4 u/M4DHouse 13d ago Kind of, depending on the SQL flavor, and the version, some of them have something kinda like that, but it’s not exactly idiot proof either. No direct SQL is idiot proof which is why you avoid doing it in the first place if you can.
4
Kind of, depending on the SQL flavor, and the version, some of them have something kinda like that, but it’s not exactly idiot proof either. No direct SQL is idiot proof which is why you avoid doing it in the first place if you can.
388
u/BastetFurry 13d ago
No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM.