francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 112 forks source link

Gojay supports for sql.Nulls but does not generate them #99

Closed OGKevin closed 5 years ago

OGKevin commented 5 years ago

Currently, one could use sql.Null.. to encode/decode structs.

e.g

    DB           sql.NullString `gojay:"db"`

    enc.SQLNullStringKey("db", &v.DB)

however, when a struct with such field gets generated via the Gojay gen tool, the bindings for these fields are not generated.

francoispqt commented 5 years ago

Hi, I have just finished replacing the code generation tool completely with the help of another contributor. I have merged it to master. It now supports generating time.Time, sql.Nulls, can also generate sync.Pool and slices on the fly. You can find the doc for the new tool here: https://github.com/francoispqt/gojay/tree/master/gojay.

Sorry for not answering earlier, I was very these pas few weeks.

Thanks

OGKevin commented 5 years ago

@francoispqt thanks for the reply, i'll certainly give the new generator a try :)