glerchundi / sqlboiler-crdb

23 stars 20 forks source link

UUID field type should be []byte not string #14

Open willbuckner opened 5 years ago

willbuckner commented 5 years ago

https://github.com/glerchundi/sqlboiler-crdb/blob/d74f22dddadb6018ed1319a3285331086386295c/driver/crdb.go#L348-L349

I was surprised to see UUID columns represented as string in generated Go. The CockroachDB Manual clearly states that this data is stored as bytes, and in my Go code, I pass them around as []byte as string conversion is a completely unnecessary waste of resources.

I realize this would be a breaking change, but can we make it configurable? Thanks for looking into this.

glerchundi commented 5 years ago

@willbuckner I don't have time right now but I found it was already discussed here: https://github.com/volatiletech/sqlboiler/issues/58, maybe ask in the core library first and depending on the status and reasoning we'll proceed with this or not.