About sql.NullInt64

200 views
Skip to first unread message

c9s

unread,
Sep 20, 2013, 2:04:52 PM9/20/13
to golan...@googlegroups.com
Hi,

I'd like to patch for structs like sql.NullInt16, sqlNullInt32.. etc to improve the memory usage.

Just wondering why not adding sql.NullInt16, sql.NullInt32 to reduce the memory allocation size? Is there any concern?

Thanks

Yo-An Lin

Carlos Castillo

unread,
Sep 22, 2013, 6:08:37 AM9/22/13
to golan...@googlegroups.com
Are you ever going to have enough columns so that the size of a single row is a problem?

The purpose of the sql.Null* types is to determine if the value of a column is null instead of the Zero Value, if it is important to know the difference. You only need to create one per necessary column to pass to rows.Scan(), use the value or null to fill you own data structures, and then re-use them for the next row.
Reply all
Reply to author
Forward
0 new messages