Use Transactions When Manually Accessing SQL Databases

preview_player
Показать описание
When connecting to a database manually to run commands it's important that those commands succeed so that we know what the state of the data is in. Transactions can help us. In this video I make the case for us to use SQL transactions when connecting manually for that protection.

This should work in all SQL databases that support transactions even though I'm showing Postgres using PSQL here.

Рекомендации по теме
Комментарии
Автор

Uhm...

All statements have transactions. Unless you specify a start and then commit/rollback... each statement is an atomic transaction.
And if you fail to commit in time, you time out and defaults to a rollback.

Note: there are other issues w transactions like isolation levels and all of this varies based on which RDBMS you use.

michaelsegel
welcome to shbcf.ru