提交 d013bd5f 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

change param name to dsn

上级 011acaac
......@@ -10,7 +10,7 @@ Parameters:
-F --field This parameter can be used to specify the fields, separated by commas. The default is all fields.
-t --table If the output format is sql, using it to specify the table name to insert data to.
--dns Specify MySQL data source connection string, used to insert data to table directly.
--dsn Specify MySQL data source connection string, used to insert data to table directly.
--clear Remove data in MySQL table before insert.
-T --trim Remove the prefix and postfix of every field when outputting data or decode data to json string.
-H --human Output a readable format, print the field name, and use the tab key to split.
......
......@@ -43,7 +43,7 @@ $>zd.exe -d demo\default.yaml -c demo\test.yaml -n 100 -o test.json # 输出jso
$>zd.exe -d demo\default.yaml -c demo\test.yaml -n 100 -o test.xml # 输出xml格式的数据。
$>zd.exe -d demo\default.yaml -n 100 -o test.sql -t user # 输出针对user表的insert语句。
$>zd.exe -d demo\default.yaml -n 100 -o test.sql -t user --trim # 输出针对user表的insert语句,去掉前缀和后缀。
$>zd.exe -c test\test-sql.yaml -t zendata.table_a --trim -dns mysql://root:P2ssw0rd@127.0.0.1:3306/zendata#utf8 --clear # 插入数据到MySQL数据表。
$>zd.exe -c test\test-sql.yaml -t zendata.table_a --trim -dsn mysql://root:P2ssw0rd@127.0.0.1:3306/zendata#utf8 --clear # 插入数据到MySQL数据表。
$>zd.exe -i demo\zentao.sql -o db # 根据sql的定义生成各表的yaml文件,存储到db目录里面。
$>zd.exe -i demo\article.txt -o demo # 转换文章为yaml配置,输出到demo目录下。
......
......@@ -128,7 +128,7 @@ func main() {
flagSet.StringVar(&vari.Table, "table", "", "")
flagSet.StringVar(&vari.Server, "s", "mysql", "")
flagSet.StringVar(&vari.Server, "server", "mysql", "")
flagSet.StringVar(&vari.DBDsn, "dns", "", "")
flagSet.StringVar(&vari.DBDsn, "dsn", "", "")
flagSet.BoolVar(&vari.DBClear, "clear", false, "")
flagSet.StringVar(&vari.ProtoCls, "cls", "", "")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册