Metadata-Version: 2.1
Name: duosql
Version: 0.1.2
Summary: An easy way to demo database transactions.
Home-page: https://github.com/johnlinp/duosql
Author: johnlinp
Author-email: johnlinp@gmail.com
License: New BSD License
Description: # duosql
        
        An easy way to demo database transactions.
        
        <img src="https://github.com/johnlinp/duosql/raw/master/images/duosql-demo.gif" width="640" height="385" />
        
        
        ## Prerequisite
        
        - Python 3.5+
        - tmux
        
        
        ## Install
        
        ```
        pip3 install duosql
        ```
        
        
        ## Usage
        
        1. Create a .duo script file. For example:
        
        ```yaml
        # 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;
        ```
        
        2. Run `duosql <script-file>` in a tmux session.
        
        3. Watch.
        
Platform: UNKNOWN
Requires-Python: >=3.5
Description-Content-Type: text/markdown
