pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

Documentation Feedback

Open aight8 opened this issue 4 years ago • 0 comments

I missing following in the doc:

  • Concrete complete examples how to register custom composit types and enum and how to register it bulletproof in ConnInfo in AfterConnect.
type MyEnumTypeString string
// ...

type MySimpleCompTypeStruct struct {
   A string
   B string
}
// ...
  • How exactly pgtype.DataType, pgtype.Value, pgtype.ValueType and my concrete go type I want to use (e.g. MyEnumTypeString, MySimpleCompTypeStruct) works together, how register it that it works smoothly in exec/query params but als rows result set (so automatic conversion of MySimpleCompTypeStruct and MyEnumTypeString in row.Values()). At best the example should be without pgtype.Status. A more common and implementation are simple nillable params without own status logic - so similar to the pgtype.zeronull package.

  • A decision tree how Preferred methods, Binary codec methods, Text codec methods, ScanValuer, format code in query params, String method, and default is used - in query params and row.Values (auto type creation).

TODO: i must maybe clearify this issue but created it already because it took lot of time to understand the working of the typesystem

aight8 avatar Jan 18 '21 13:01 aight8