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

1.1

上级 c5e4b23a
......@@ -10,16 +10,12 @@ zendata是一款通用的数据生成工具,您可以使用yaml文件来定义
-F --field 可通过该参数指定要输出的字段列表,用逗号分隔。 默认是所有的字段。
-t --table 输出格式为sql时,需通过该参数指定要插入数据的表名。
-H --human 输出可读格式,打印字段名,并使用tab键进行分割。
-r --recursive 递归模式。如不指定,默认为平行模式。平行模式下各个字段独立循环。
递归模式下每个字段的取值依赖于前一字段。可增强数据的随机性。
-p --port 在指定端口上运行HTTP服务。可通过http://ip/接口获得JSON格式的数据。服务模式下只支持数据生成。
-b --bind 监听的ip地址,默认监听所有的ip地址。
-R --root 运行HTTP服务时根目录。客户端可调用该根目录下面的配置文件。如果不指定,取zd可执行文件所在目录。
-i --input 指定一个schema文件,输出每个表的yaml配置文件。需通过-o参数指定一个输出的目录。
-s --server 数据库服务器类型,支持mysql|oracle|sqlite|sqlserver,默认为mysql。可用于解析yaml文件或者生成SQL。
-D --decode 根据指定的配置文件,将通过-i参数指定的数据文件解析成json格式,可通过-H参数输出可读格式。
-e --example 打印示例的数据格式配置文件。
-l --list 列出所有支持的数据格式。
......@@ -38,7 +34,10 @@ $>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 -s mysql 输出插入到user表里面的sql。
$>zd.exe -i db.sql -s mysql -o db 根据db.sql的定义生成每个表的yaml文件,存储到db目录里面。
$>zd.exe -c demo\default.yaml -i test.txt --decode 将-i指定的文件根据-d参数的配置进行解析。
$>zd.exe -l # 列出所有內置数据。
$>zd.exe -v system.address.v1 # 查看內置Excel文件system/address/v1.xlsx中的数据表。
$>zd.exe -v system.address.v1.china # 查看內置Excel文件china数据表中的数据。
服务模式举例:
......
......@@ -25,10 +25,6 @@ Parameters
-i --input Specify a sql schema file and output the YAML config file for each table.
You need to specify an output directory by using -o.
-s --server Database server type. Support mysql|oracle|sqlite|sqlserver.
The default is mysql. This parameter can be used to parse YAML files or generate SQL.
-D --decode Referring to the specified configuration file, parse the data file specified by -i and output json.
Also you can output the readable format via -H.
-e --example Print the data format config file of the example.
-l --list List all supported data formats.
......@@ -46,8 +42,11 @@ $>zd.exe -d demo/default.yaml -c demo/test.yaml -n 100 -o test.json # Output da
$>zd.exe -d demo/default.yaml -c demo/test.yaml -n 100 -o test.xml # Output data in XML.
$>zd.exe -d demo/default.yaml -n 100 -o test.sql -t user -s mysql # Output the sql inserted into the table user.
$>zd.exe -i db.sql -s mysql -o db # Generate YAML files for each table by parsing db.sql and store them in the db directory.
$>zd.exe -c demo/default.yaml -i test.txt --decode # Parse the file specified by -i according to the config of -d.
$>zd.exe -i db.sql -o db # Generate YAML files for each table by parsing db.sql and store them in the db directory.
$>zd.exe -l # List all build-in data types.
$>zd.exe -v system.address.v1 # View data types in build-in Excel file system/address/v1.xlsx.
$>zd.exe -v system.address.v1.china # View data items in Excel sheet "china".
Service Example
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册