pgtype.Row() was optimized for a single line use
without much ceremony at a cost of OID registration,
which is cumbersome. In practice it so much incovnenience
to create new Composite just before making a query.
So now there is just a Composite type and 2 helper methods:
- SetFields sets composite fields to values passed. This assignment
fails if types passed are not assignable to Values pgtype is
made of.
- Scan acts exactly like query.Scan, but for a composite value. Passed
values are set to values from SQL composite.
Composite() function returns a private type, which should
be registered with ConnInfo.RegisterDataType for the composite
type's OID.
All subsequent interaction with Composite types is to be done
via Row(...) function. Function return value can be either
passed as a query argument to build SQL composite value out of
individual fields or passed to Scan to read SQL composite value
back.
When passed to Scan, Row() should have first argument of type
*bool to flag NULL values returned from query.