You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand how I can create a column that may be NULL in the database. Take a struct like the following:
typePersonstruct {
IDint64BossID sql.NullInt64
}
When a database is created by modl, the type of the column BossID (at least for sqlite3) is text. Why is that?
I have found the code mapping a column to the type here: https://github.com/jmoiron/modl/blob/master/dialect.go#L111-L112 It seems that it does test for the type name NullableInt64 instead of NullInt64. Is that intentional or a bug? I was unable to find any reference to the string NullableInt64, except in an early discussion on how to name the types within sql.Null*.
Creating a custom type works, but I don't think that this is the way it is supposed to be:
typeNullableInt64 sql.NullInt64
Now a database column with the type integer is created.
Am I missing something?
The text was updated successfully, but these errors were encountered:
Hi, thanks for writing this library!
I don't understand how I can create a column that may be NULL in the database. Take a struct like the following:
When a database is created by modl, the type of the column
BossID
(at least for sqlite3) istext
. Why is that?I have found the code mapping a column to the type here: https://github.com/jmoiron/modl/blob/master/dialect.go#L111-L112 It seems that it does test for the type name
NullableInt64
instead ofNullInt64
. Is that intentional or a bug? I was unable to find any reference to the stringNullableInt64
, except in an early discussion on how to name the types withinsql.Null*
.Creating a custom type works, but I don't think that this is the way it is supposed to be:
Now a database column with the type
integer
is created.Am I missing something?
The text was updated successfully, but these errors were encountered: