17 Commits

Author SHA1 Message Date
Jack Christensen
6972a57421 pgtype.OID type should only be used for scanning and encoding values
It was a mistake to use it in other contexts. This made interop
difficult between pacakges that depended on pgtype such as pgx and
packages that did not like pgconn and pgproto3. In particular this was
awkward for prepared statements.

This is preparation for removing pgx.PreparedStatement in favor of
pgconn.PreparedStatement.
2019-08-24 13:55:57 -05:00
Jack Christensen
1b8f0016e9 Split pgtype into own repo 2019-04-20 19:20:00 -05:00
Jack Christensen
cc3461e65d Use golang.org/x/xerrors 2019-04-20 17:43:44 -05:00
Jack Christensen
efb333df6b Fix go modules
Wow. This is fun. Sure is easy to get modules wrong when upgrading a v2+
project.
2019-04-20 17:41:08 -05:00
Jack Christensen
858d00788a Use extracted packages with Go modules 2019-04-05 10:59:47 -05:00
Jack Christensen
e78fd95296 Fix switching CommandTag back to string 2019-01-05 18:53:07 -06:00
Jack Christensen
356a6c43d2 Avoid allocating strings in common message types 2019-01-01 13:47:37 -06:00
Jack Christensen
897e90f353 Type modifier should be int32 not uint32 2018-09-22 07:43:18 -05:00
Jack Christensen
db7df79e10 Add domain support
fixes #407
2018-04-07 14:04:16 -05:00
Jack Christensen
ab9a1af65b Add support for array of enum
fixes #338
2017-10-17 20:31:11 -05:00
Kelsey Francis
953e08df99 Prefix types in namespaces other than pg_catalog or public
It's possible to define a type (e.g., an enum) with the same name in two
different schemas. When initializing data types after connecting, types
defined within schemas other than pg_catalog or public should be
qualified with their schema name to disambiguate them and ensure all
types with the same base name get added to the map of OID to type.

Prior to this commit, the last type scanned would "win", and all others
with the same name would be missing from the ConnInfo type maps, which
would subsequently cause any PREPARE involving columns of those missing
types to return the error "unknown oid".
2017-09-11 11:29:42 -07:00
Jack Christensen
53b4280456 Automatically register enum types
fixes #287
2017-07-04 11:38:50 -05:00
Jack Christensen
8f4178b3d3 Use github.com/pkg/errors 2017-06-04 21:30:03 -05:00
Jack Christensen
27ab289096 Use Go casing convention for OID 2017-06-03 11:53:49 -05:00
Jack Christensen
d1fd222ca5 Add transaction context support 2017-05-20 17:58:19 -05:00
Jack Christensen
3080d0ee4d Do not create empty slices in Bind.Decode 2017-05-19 15:50:27 -05:00
Jack Christensen
479ebdfa19 Add basic pgmock support
Primarily useful for testing pgx itself. Design is still subject to change.
2017-05-13 17:56:54 -05:00