fraenky8 / tables-to-go

convert your database tables to structs easily
MIT License
233 stars 42 forks source link

give an option to choose beteween sql.Null* and pointers for NULL columns #14

Closed fraenky8 closed 5 years ago

fraenky8 commented 5 years ago

Implement one more command line flag to determine which data type to use for NULL columns:

kaihendry commented 5 years ago

Could you also generate JSON tags with omitempty for optional NULL columns please?

fraenky8 commented 5 years ago

@kaihendry: sorry but I don't want to introduce json tags in a tool which handles mapping database tables to structs. Like I tried to explain here, working with your tables from the database and representing the data in what format whatsoever are two different concerns which I dont want to mix here.

kaihendry commented 5 years ago

Yeah, you're right. I can add them myself with :GoAddTags but I am super lazy with marking the optional values as omitempty.

kaihendry commented 5 years ago

I found the null documentation a little weird. https://youtu.be/1mnMmMF3Dx0?t=451

native|primitive? Just a comment. No need to change anything.

fraenky8 commented 5 years ago

Hm I see, maybe I should point it more out which options means what.