From 4171f554d42aa8429e2a7f6790af17459e7c6baa Mon Sep 17 00:00:00 2001 From: mateuszkowalke Date: Thu, 22 Aug 2024 06:51:58 +0200 Subject: [PATCH] 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. --- pgtype/doc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pgtype/doc.go b/pgtype/doc.go index d56c1dc70..7687ea8fe 100644 --- a/pgtype/doc.go +++ b/pgtype/doc.go @@ -53,6 +53,9 @@ similar fashion to database/sql. The second is to use a pointer to a pointer. return err } +When using nullable pgtype types as parameters for queries, one has to remember +to explicitly set their Valid field to true, otherwise the parameter's value will be NULL. + JSON Support pgtype automatically marshals and unmarshals data from json and jsonb PostgreSQL types.