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>. -
Watch.
Metadata
Release files for duosql 0.1.6
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.6.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duosql-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / duosql-0.1.6.tar.gz
| Download URL | duosql-0.1.6.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb180632e1aa80e90df8ef9aab7965875d71f7d444db271c904b193c594c565e
|
|
BLAKE2b-256 checksum How to use checksums |
ae5b62b1b21e1e7e0acf029df4039e369179fc9c9f964575a898244d7317c3ac
|
| 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.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.16
|
Release files / duosql-0.1.6-py3-none-any.whl
| Download URL | duosql-0.1.6-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5da29ceab69e8535a7306f0705ab6cbeb399c11ab2f14fb562baa863651f9f0a
|
|
BLAKE2b-256 checksum How to use checksums |
c6205645c906db7d994c1268bc60047ad4a2682d624a3d36959de1b11b90bf16
|
| 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.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.16
|