jmoiron / modl

golang database modelling library
MIT License
480 stars 48 forks source link

Not nullable support and dialect fixes #42

Closed japettyjohn closed 2 years ago

japettyjohn commented 8 years ago

Currently all fields when created are left to the database default in terms of being nullable or not nullable - generally this means nullable. Primary drawback to this is performance. I've address this by making not nullable the default, overridable by column, but making slices, ptrs, arrays, interfaces and sql.Scanner as nullable.

The Dialects were also updated to deal with pointers in ToSqlType, use RawBytes instead of NullableBytes (a typo it seems) and NullTime instead of Nulltime (postgresql dialect typo).

Dialects similarly could not be made outside of the package because a few of the ColumnMap fields were private, these were made public.