Skip to main content

duosql

An easy way to demo 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 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;
  1. Run duosql <script-file> in a tmux session.

  2. 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)

Source distribution for duosql 0.1.1
File Size Uploaded
duosql-0.1.1.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duosql 0.1.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.1.8

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

This release

0.1.1 This release

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