Replies: 1 comment 1 reply
-
You're correct, however this would be a breaking change so cannot be done until However, if you can send in a PR it would be appreciated so that it is not forgotten when v5 starts being worked on. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Due to the nature of golang's design of
int
,int32
andint64
, sometimes it is very confusing to generate a type ofint
. In my opinion, if we can decide it is a 32bit number, I would argue generating anint32
type rather thanint
type is preferable.Here in MYSQL 8.4, they have integer types of 1, 2, 3, 4, 8 bytes. While the generating rule in
drivers/sqlboiler-mysql/driver/mysql.go
about the 4 byte integerINT
looks like this (Master branch as of now Aug 28th 2024):When mysql stores a 4 byte integer number, the generated type is
Int
orUint
. Considering nowadays most of us are using 64-bit systems, then the generated type will be a 8 byte integer, some static checking tools likegosec
would complain if we're trying to cast this toint32
. Considering people use protobuf a lot and it requires to assignint32
andint64
explicitly, it is not rare that people would do such an casting operation.In short, I would suggest to change this to generate
null.Uint32
andnull.Int32
in this part.Beta Was this translation helpful? Give feedback.
All reactions