4 ms·
Maybe there is already something like this but this would be sick for sql DBs. Having to make prod updates to a table always terrifies me.
by jagtstronaut 3y ago
Maybe there is already something like this but this would be sick for sql DBs. Having to make prod updates to a table always terrifies me.
- hybby 3y agomaybe you could run the updates in a transaction that you could roll back if you were unhappy with the result?
- peter422 3y agoJust run the whole operation in a transaction and verify whatever you need to verify before committing.
- Avery3R 3y agoBEGIN TRANSACTION; ... ; Modify DB ... ; Inspect State ROLLBACK TRANSACTION; and then switch the rollback to commit when satisfied
- jagtstronaut 3y agoThis is cool I probably will do this.
- wnolens 3y agoJust mind the isolation level of concurrent queries which may be running. By default you are probably fine since it's usually snapshot isolation mode (will only see committed results as of query start) but there are other modes that break this.