Skip to content

Instantly share code, notes, and snippets.

@yfuruyama
Created December 2, 2018 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yfuruyama/2ec4e05c7ed54aae787cbbc52fdd8271 to your computer and use it in GitHub Desktop.
Save yfuruyama/2ec4e05c7ed54aae787cbbc52fdd8271 to your computer and use it in GitHub Desktop.
+---------------------------------------------------+---------------------------------------------------------------+
| tx1 | tx2 |
+---------------------------------------------------+---------------------------------------------------------------+
| spanner> BEGIN RO; | |
| Query OK, 0 rows affected (0.00 sec) | |
| | |
| | spanner> BEGIN; |
| | Query OK, 0 rows affected (0.02 sec) |
| | |
| spanner> SELECT * FROM Accounts WHERE UserId = 1; | |
| +--------+---------+----------+ | |
| | UserId | Balance | Type | | |
| +--------+---------+----------+ | |
| | 1 | 1000 | Checking | | |
| +--------+---------+----------+ | |
| 1 rows in set (3.11 msecs) | |
| | |
| | spanner> UPDATE Accounts Set Balance = 2000 WHERE UserId = 1; |
| | Query OK, 1 rows affected (0.76 sec) |
| | |
| | spanner> COMMIT; |
| | Query OK, 0 rows affected (0.18 sec) |
| | |
| spanner> SELECT * FROM Accounts WHERE UserId = 1; | |
| +--------+---------+----------+ | |
| | UserId | Balance | Type | | |
| +--------+---------+----------+ | |
| | 1 | 1000 | Checking | | |
| +--------+---------+----------+ | |
| 1 rows in set (3.18 msecs) | |
| | |
| spanner> CLOSE; | |
| Query OK, 0 rows affected (0.00 sec) | |
| | |
+---------------------------------------------------+---------------------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment