This is a transaction tester for MySQL.
mytx is motivated to simplify the test process of checking lock status in MySQL.
$ mytx [options] PLAN-FILE.txt
- PLAN-FILE.txt
- Specify a transaction number and SQL command in one line
- Split the transaction-number and SQL by
,
- Need not
BEGIN
statement at the begining of commands.
- Split the transaction-number and SQL by
- like...
- Specify a transaction number and SQL command in one line
1,UPDATE t1 SET c2 = 70 WHERE id = 4
2,SELECT * from t1 WHERE id = 4
1,ROLLBACK
2,COMMIT
- options
-c
: to specify a file includes SQLs for internalc
command-host(H)
hostname of your MySQL-init(i)
to specify a .sql file to initialize your MySQL.-user(u)
username of your MySQL-password(p)
password of your MySQL-database(db or d)
database name of your MySQL-port(P)
port number(int) of your MySQL
- Prepare the transactions and arrange in the order you want to execute in some file(PLAN-FILE)
- If needed, you can prepare the SQLs to check any status in MySQL in another file(CHECK-SQLs)
- Execute with options you need
- For each line in the (PLAN-FILE), you can check the check lock status by commands in (CHECK-SQLs)
- s: skip the command
- c[n]: execute the [n]th check command
- (enter): execute the command
To install, use go get
:
$ go get -d github.com/tom--bo/mytx
- Fork (https://github.com/tom--bo/mytx/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create a new Pull Request