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.1
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.1.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duosql-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / duosql-0.1.1.tar.gz
| Download URL | duosql-0.1.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
532d60e872d0ec5d0ca7eaab1ae18d35e358cfa40b62c3f5cb9f4c6c82650959
|
|
BLAKE2b-256 checksum How to use checksums |
8caabcddc9060d0a660ad23c7a8a42d86bdc9d45640023ee95349035870c55d0
|
| 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.1-py3-none-any.whl
| Download URL | duosql-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
631c2ecaec05b6b07f86eab188f2db3a4f5cc51aa4929283e37a68b39b88ca2e
|
|
BLAKE2b-256 checksum How to use checksums |
effb0293d938138e7ee3601785c763442a6fc6a9b5fd280df1dbfbde02130dbd
|
| 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
|