Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goctl gen model mysql from datasource do not return sql.Nullstring sql.Int64 with Null column #4336

Open
handestd opened this issue Aug 27, 2024 · 5 comments
Assignees

Comments

@handestd
Copy link

handestd commented Aug 27, 2024

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,..

@kevwan
Copy link
Contributor

kevwan commented Aug 28, 2024

Duplicate of #4337?

@handestd
Copy link
Author

Duplicate of #4337?

Yes, i think i didn't explain clearly

@handestd
Copy link
Author

Duplicate of #4337?

can you explain is this a goctl bug or am i doing something wrong, thanks

@kevwan
Copy link
Contributor

kevwan commented Aug 28, 2024

@kesonan

@handestd handestd reopened this Aug 29, 2024
@handestd
Copy link
Author

I need help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants