duosql
An easy way to demo database transactions.
Prerequisite
- Python 3.5+
- tmux
Install
pip3 install duosql
Usage
- Create a .duo script file. For example:
# connect command
connect: mysql -ujohnlinp -psecret duosql
# create table and populate data
left: CREATE TABLE IF NOT EXISTS person (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, PRIMARY KEY (id));
left: INSERT INTO person (name) VALUES ('John Lin');
# start left transaction
left: BEGIN;
left: SELECT COUNT(*) FROM person FOR UPDATE;
# start right transaction
right: BEGIN;
right: SELECT COUNT(*) FROM person FOR UPDATE;
-
Run
duosql <script-file>in a tmux session. -
Watch.
Metadata
Release files for duosql 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| duosql-0.1.2.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duosql-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / duosql-0.1.2.tar.gz
| Download URL | duosql-0.1.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f32f04a537c5c1afd7249406dbf74eace2acccab79e0ca174f5d779c0919bc1b
|
|
BLAKE2b-256 checksum How to use checksums |
53fb1aa9e893a6e7ff9d331e52802fec5cddbf1fadee461d0b774dc58800d828
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15
|
Release files / duosql-0.1.2-py3-none-any.whl
| Download URL | duosql-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec98663111413d176bf5876ef76926d6303341b951db883a04c093bae7ecc6f0
|
|
BLAKE2b-256 checksum How to use checksums |
6eb69a41958ab60c87c52fdba1440b8f98c5cb1ccb518043cb08b7d8e5b867f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15
|