Skip to main content

duosql

An easy way to demonstrate database transactions.

Prerequisite

  • Python 3.5+
  • tmux

Install

pip3 install duosql

Usage

  1. Create a .duo script file. For example:
# connect command
connect: mysql -ujohnlinp -psecret somedb

# create table and populate data
left: DROP TABLE IF EXISTS person;
left: CREATE TABLE person (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, age INT NOT NULL, PRIMARY KEY (id));
left: INSERT INTO person (name, age) VALUES ('John Lin', 29);

# start left transaction
left: SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
left: BEGIN;
left: SELECT age FROM person WHERE id = 1;

# start right transaction
right: BEGIN;
right: UPDATE person SET age = 30 WHERE id = 1;

# continue left transaction
left: SELECT age FROM person WHERE id = 1;

# continue right transaction
right: ROLLBACK;
  1. Run duosql <script-file>.

  2. Watch.

Release files for duosql 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duosql 0.1.8
File Size Uploaded
duosql-0.1.8.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duosql 0.1.8
File Interpreter ABI Platform
duosql-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / duosql-0.1.8.tar.gz

Download URL duosql-0.1.8.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9c1dcc159a41a614b03c7ea7f031e6608ecfdb8e3bbdf9cca8f47da2b15b9e85
BLAKE2b-256 checksum
How to use checksums
382ea2da119cfadf2c3b3960137c69d58b80b989c7826a1b3f06aace0f74ca8a
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.8-py3-none-any.whl

Download URL duosql-0.1.8-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6a7d351b0ac4b5158f95b399380a62cbf68bcd5ab4fc1c6d63bbb46f119d4d6
BLAKE2b-256 checksum
How to use checksums
c2f464e116a3dfabb84eab0a333a818ddf03bf6ecd27d04a0f2d98efd856ff66
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 history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page