Skip to content

Commit

Permalink
update: 优化参数描述,更新说明文档
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Mar 1, 2020
1 parent 5768c81 commit 499bc9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ bingo2sql --server --config=config.ini

**解析模式**

- --stop-never 持续解析binlog。可选。默认False,同步至执行命令时最新的binlog位置。
- --stop-never 持续解析binlog。可选。默认false,同步至执行命令时最新的binlog位置。

- -K, --no-primary-key 对INSERT语句去除主键。可选。默认False
- -K, --no-primary-key 对INSERT语句去除主键。可选。默认false

- -B, --flashback 生成回滚SQL,可解析大文件,不受内存限制。可选。默认False。与stop-never或no-primary-key不能同时添加。
- -B, --flashback 生成回滚SQL,可解析大文件,不受内存限制。可选。默认false。与stop-never或no-primary-key不能同时添加。

- -M, --minimal-update 最小化update语句. 可选. (default false)
- -M, --minimal-update 最小化update语句. 可选. (default true)

- -I, --minimal-insert 使用包含多个VALUES列表的多行语法编写INSERT语句. (default true)

**解析范围控制**

Expand Down Expand Up @@ -81,7 +83,7 @@ bingo2sql --server --config=config.ini

-t, --tables 只解析目标table的sql,多张表用逗号隔开,如-t tbl1,tbl2。可选。默认为空。

--ddl 解析ddl,仅支持正向解析。可选。默认False
--ddl 解析ddl,仅支持正向解析。可选。默认false

--sql-type 只解析指定类型,支持 insert,update,delete。多个类型用逗号隔开,如--sql-type=insert,delete。可选。默认为增删改都解析。

Expand Down
10 changes: 5 additions & 5 deletions cmd/bingo2sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ var (
)

var (
runServer = flagBoolean("server", "s", false, "启动API服务")
configFile = flag.StringP("config", "c", "config.ini", "以服务方式启动时可指定配置文件")

host = flag.StringP("host", "h", "", "数据库地址")
port = flag.IntP("port", "P", 3306, "端口号")
user = flag.StringP("user", "u", "", "用户名")
Expand All @@ -52,15 +49,15 @@ var (
stopTime = flag.String("stop-time", "", "结束时间")

databases = flag.StringP("databases", "d", "", "数据库列表,多个时以逗号分隔")
tables = flag.StringP("tables", "t", "", "表名,如果数据库为多个,则需指名表前缀,多个时以逗号分隔")
tables = flag.StringP("tables", "t", "", "表名或表结构文件.远程解析时指定表名(可多个,以逗号分隔),本地解析时指定表结构文件")

threadID = flag.Uint64P("connection-id", "C", 0, "指定线程ID")

flashback = flagBoolean("flashback", "B", false, "逆向语句")

parseDDL = flagBoolean("ddl", "", false, "解析DDL语句(仅正向SQL)")

sqlType = flag.String("type", "insert,delete,update", "解析的语句类型")
sqlType = flag.String("sql-type", "insert,delete,update", "解析的语句类型")

maxRows = flag.Int("max", 100000, "解析的最大行数,设置为0则不限制")

Expand All @@ -81,6 +78,9 @@ var (
showAllTime = flagBoolean("show-all-time", "", false, "显示每条SQL的执行时间")
showThread = flagBoolean("show-thread", "", false, "显示线程号,便于区别同一进程操作")

runServer = flagBoolean("server", "s", false, "启动API服务")
configFile = flag.StringP("config", "c", "config.ini", "以服务方式启动时需指定配置文件")

debug = flagBoolean("debug", "", false, "调试模式,输出详细日志")
cpuProfile = flagBoolean("cpu-profile", "", false, "调试模式,开启CPU性能跟踪")
)
Expand Down

0 comments on commit 499bc9a

Please sign in to comment.