go-zero
go-zero copied to clipboard
goctl gen model mysql from datasource do not return sql.Nullstring sql.Int64 with Null column
i used this command
goctl model mysql datasource --url "root:@tcp(127.0.0.1:3306)/qrmenu" --dir ./internal/model --style go_zero --table "*" --cache=true
my table structure `-- auto-generated definition create table group_topping_option ( id varchar(255) not null primary key, shop_id varchar(255) null, group_topping_id varchar(255) null, name varchar(255) null, price int null, create_at datetime default current_timestamp() not null, update_at datetime default current_timestamp() not null on update current_timestamp(), create_by varchar(255) not null, update_by varchar(255) not null );
`
the result i receive:
GroupToppingOption struct {
Id string db:"id"
ShopId string db:"shop_id"
GroupToppingId string db:"group_topping_id"
Name string db:"name"
Price int64 db:"price"
CreateAt time.Time db:"create_at"
UpdateAt time.Time db:"update_at"
CreateBy string db:"create_by"
UpdateBy string db:"update_by"
}
I expected Nullstring, NullInt64,..
Duplicate of #4337?
Duplicate of #4337?
Yes, i think i didn't explain clearly
Duplicate of #4337?
can you explain is this a goctl bug or am i doing something wrong, thanks
@kesonan
I need help
This issue is stale because it has been open for 30 days with no activity.