$ k2ctl model mysql ddl -src="./*.sql" -dir="./sql/model" -c
通过datasource生成
k2ctl model mysql datasource -url="user:password@tcp(127.0.0.1:3306)/database" -table="*" -dir="./model"
用法
$ k2ctl model mysql -h
NAME:
k2ctl model mysql - generate mysql model"
USAGE:
k2ctl model mysql command [command options] [arguments...]
COMMANDS:
ddl generate mysql model from ddl"
datasource generate model from datasource"
OPTIONS:
--help, -h show help
k2ctl model mysql -src={patterns} -dir={dir} -cache
help
NAME:
k2ctl model mysql ddl - generate mysql model from ddl
USAGE:
k2ctl model mysql ddl [command options] [arguments...]
OPTIONS:
--src value, -s value the path or path globbing patterns of the ddl
--dir value, -d value the target dir
--style value the file naming format, see [https://github.com/k2let/tree/master/k2ctl/config/readme.md]
--cache, -c generate code with cache [optional]
--idea for idea plugin [optional]
datasource
k2ctl model mysql datasource -url={datasource} -table={patterns} -dir={dir} -cache=true
help
NAME:
k2ctl model mysql datasource - generate model from datasource
USAGE:
k2ctl model mysql datasource [command options] [arguments...]
OPTIONS:
--url value the data source of database,like "root:password@tcp(127.0.0.1:3306)/database
--table value, -t value the table or table globbing patterns in the database
--cache, -c generate code with cache [optional]
--dir value, -d value the target dir
--style value the file naming format, see [https://github.com/k2let/tree/master/k2ctl/config/readme.md]
--idea for idea plugin [optional]