2
0

Add documentation for pointer to pointer null mapping

This commit is contained in:
Jack Christensen
2015-09-08 12:15:16 -05:00
parent 73135865e7
commit e4f401f6ec
3 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -121,8 +121,16 @@ notification.
Null Mapping
pgx includes Null* types in a similar fashion to database/sql that implement the
necessary interfaces to be encoded and scanned.
pgx can map nulls in two ways. The first is Null* types that have a data field
and a valid field. They work in a similar fashion to database/sql. The second
is to use a pointer to a pointer.
var foo pgx.NullString
var bar *string
err := conn.QueryRow("select foo, bar from widgets where id=$1", 42).Scan(&a, &b)
if err != nil {
return err
}
Array Mapping