zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.37k stars 3.97k forks source link

i generate code from datasource not getting sql data type nullstring #4337

Open handestd opened 3 months ago

handestd commented 3 months ago

I generate code from datasource and don't get nullstring sql data type, but generating from sql file still get nullstring data type.

its work (from sql file): goctl model mysql ddl --src schema/db.sql --dir ./internal/model --style go_zero

its not work (from datasource): goctl model mysql datasource --url "root:@tcp(127.0.0.1:3306)/qrmenu" --dir ./internal/model --style go_zero --table "*" --cache=true the result i expected: image

kesonan commented 2 months ago

Please refer to the documentation https://go-zero.dev/docs/tutorials/cli/model#%E7%B1%BB%E5%9E%8B%E6%98%A0%E5%B0%84%E8%87%AA%E5%AE%9A%E4%B9%89