News for hackers. Stuff that matters.
Re:Show HN: Sqlkit – Golang SQL package with nested transact... by wrs on Saturday July 13, 2019 @05:23PM (#20430244)
There's an inherent semantic mismatch here. SQL scalars have a dimension (NULL) that Go scalars don't have, so Go scalars just don't have enough information to represent SQL values. You have to put that dimension somewhere. Rather than using Go's separate dimension of nil-ness of pointers, you could put it in a separate boolean return value, or wrap it in a struct (see C#'s Nullable<T>), or make it queryable with a separate method (like IsNull(index)). Whatever it is, it also has to be two-way, so you can write NULLs as well as read them.

There are no comments on this comment yet.