mirror of https://github.com/jackc/pgx.git
Add documentation for pointer to pointer null mapping
parent
73135865e7
commit
e4f401f6ec
|
@ -1,5 +1,6 @@
|
||||||
# Master
|
# Master
|
||||||
|
|
||||||
|
* Add null mapping to pointer to pointer (Jonathan Rudenberg)
|
||||||
* Add JSON and JSONB type support (Joseph Glanville)
|
* Add JSON and JSONB type support (Joseph Glanville)
|
||||||
|
|
||||||
# 2.6.0 (September 3, 2015)
|
# 2.6.0 (September 3, 2015)
|
||||||
|
|
|
@ -22,6 +22,7 @@ Pgx supports many additional features beyond what is available through database/
|
||||||
* JSON and JSONB support
|
* JSON and JSONB support
|
||||||
* Maps inet and cidr PostgreSQL types to net.IPNet
|
* Maps inet and cidr PostgreSQL types to net.IPNet
|
||||||
* Large object support
|
* Large object support
|
||||||
|
* Null mapping to Null* struct or pointer to pointer.
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
|
|
12
doc.go
12
doc.go
|
@ -121,8 +121,16 @@ notification.
|
||||||
|
|
||||||
Null Mapping
|
Null Mapping
|
||||||
|
|
||||||
pgx includes Null* types in a similar fashion to database/sql that implement the
|
pgx can map nulls in two ways. The first is Null* types that have a data field
|
||||||
necessary interfaces to be encoded and scanned.
|
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
|
Array Mapping
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue