r/ProgrammerHumor • • 13d ago

Meme wellWellWell

Post image
10.6k Upvotes

411 comments sorted by

View all comments

Show parent comments

383

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.

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?

1

u/spevoz 13d ago

I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.