Skip to content

Commit 4171f55

Browse files
committed
Add additional info for nullable pgtype types
Additional information warns about using nullable types being used as parameters to query with Valid set to false.
1 parent 4f7e19d commit 4171f55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pgtype/doc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ similar fashion to database/sql. The second is to use a pointer to a pointer.
5353
return err
5454
}
5555
56+
When using nullable pgtype types as parameters for queries, one has to remember
57+
to explicitly set their Valid field to true, otherwise the parameter's value will be NULL.
58+
5659
JSON Support
5760
5861
pgtype automatically marshals and unmarshals data from json and jsonb PostgreSQL types.

0 commit comments

Comments
 (0)