gen_sqlx_code

command module
v0.0.0-...-73bfd39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 9 Imported by: 0

README

gen_sqlx_code

用于生成支持sqlx库的代码。

使用方法:
  • 在程序目录下面增加配置文件config.ini
  • config.ini文件格式:
[ha666db]
address = 127.0.0.1
port = 3306
name = ha666db
account = root
password = 1234567890
conn_name = ha666db
执行命令:
  • windows:gen_sqlx_code.exe -t mysql -p ha666db (ha666db是配置文件中的section名称)
  • darwin:./gen_sqlx_code -t mysql -p ha666db (ha666db是配置文件中的section名称)
数据库表结构建议:
  • 支持:mysql数据库、mssql数据库
  • 表名:下划线命名法、驼峰命名法、大驼峰命名法
  • 字段名:驼峰命名法、大驼峰命名法
  • 所有字段不允许为空
  • 一定要有主键
  • 主键推荐int、bigint、varchar,这三种类型
  • 索引提前创建好
  • 所有表、字段、索引都提前加好注释
  • createTime字段必须有默认值CURRENT_TIMESTAMP
  • updateTime字段必须有默认值CURRENT_TIMESTAMP,并且设置on update CURRENT_TIMESTAMP

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL