Transaction Coordinator for SQL execution in different database
- guaranteed different database statements in a logic transaction
- each database only used one connection to execute multiple sql files
download binary from release
./txcoordinator --cfg ./cfg.toml --dir ./sqlfiles
[[databases]]
schema = "db1"
secret = "postgres://postgres:@127.0.0.1/db1"
[[databases]]
schema = "db2"
secret = "postgres://postgres:@127.0.0.1/db2"
[[databases]]
schema = "db3"
secret = "postgres://postgres:@127.0.0.1/db3"
filename pattern: {sql_index}-{database_name}-{table_name}.sql
0-db1-t0.sql
1-db1-t1.sql
0-db2-t.sql
0-db3-t.sql
It groups sqlfiles using database_name
and executes sql in ascending order of sql_index
. In above example, the ececution order of db1 is 0-db1-t0.sql, 1-db1-t1.sql
make db
to start integrated PostgreSQLmake simulate
to simulate real environment rollback operation