SQL 转 Go Struct
粘贴 MySQL 建表语句(支持多条 CREATE TABLE),可空列生成指针类型,自动补 time import
SQL 建表语句
Go Struct
package model
import "time"
type Users struct {
Id int64 `db:"id" json:"id"`
NickName string `db:"nick_name" json:"nick_name"`
Age *int32 `db:"age" json:"age"`
Balance float64 `db:"balance" json:"balance"`
CreatedAt time.Time`db:"created_at" json:"created_at"`
}