You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
基于数据库表结构自定义模版生成多种编程语言代码的命令行工具,支持 MySQL 和 PostgresSQL。
A command-line tool that generates codes in multiple programming languages based on custom templates of database table structures, supporting MySQL and PostgresSQL.
Install
cargo install sql_reverse
sql_reverse
USAGE:
sql_reverse <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
export Export default database field types
help Prints this message or the help of the given subcommand(s)
mysql Mysql OPTIONS
postgres PostgresSQL OPTIONS
sql_reverse mysql/postgres [OPTIONS]
USAGE:
sql_reverse mysql/postgres [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c <custom-field-type> Custom field type, example: -c ./default.json [default: ]
-f <file> Input database config file to read, example: -f ./reverse.yml [default: ./reverse.yml]
-s <suffix> Suffix of the generated file, example: -s rs [default: rs]
-n <template-name> Input template name, example: -n base.tera [default: base.tera]
-p <template-path> Input template path example: -p 'templates/*' [default: templates/*]
Exec,you need to make sure you're in the same directory as templates.
sql_reverse export
sql_reverse mysql -f reverse.yml
sql_reverse postgres -f reverse.yml