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.3

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.3
File Size Uploaded
duosql-0.1.3.tar.gz 2.9 kB Details

Built distribution (wheel)

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

Total release size: 6.9 kB

Release files / duosql-0.1.3.tar.gz

Download URL duosql-0.1.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
621b2ec4b251d68d403ec4a71cbbcef6ba0970c3cddc9242acb628375b3854fb
BLAKE2b-256 checksum
How to use checksums
0886111b9560de2af9acb291e73962b039eb2d74bef94a54a68b90267ef63af9
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.3-py3-none-any.whl

Download URL duosql-0.1.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ec2bbd2f3061ba76587cbaff8266f9420323015ec10a4632e46c95d41347916
BLAKE2b-256 checksum
How to use checksums
0411a96d2fbe4928b77c2a88064c470b4fe4dec6dcdc3aaca4042dd0b9cde048
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

This release

0.1.3 This release

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