Skip to main content

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

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

  2. Watch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
duosql-0.1.5-py3-none-any.whl (4.3 kB) Copy SHA256 hash SHA256 Wheel py3
duosql-0.1.5.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page