An easy way to demo database transactions.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
duosql-0.1.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
duosql-0.1.2-py3-none-any.whl
(4.0 kB
view hashes)