19 Commits

Author SHA1 Message Date
Jack Christensen
703ce85513 Generate UUIDArray from template
- Fix error in Set
- Specifically handle untyped nil
2017-08-29 14:33:25 -05:00
Jack Christensen
654adbdd4a Use Go casing convention for CID/TID/XID/CIDR 2017-06-03 12:01:49 -05:00
Jack Christensen
01fa5960b2 Use Go casing convention for ACLItem 2017-06-03 11:58:40 -05:00
Jack Christensen
cc873a0bcf Add pgtype.NumericArray 2017-04-03 07:46:45 -05:00
Jack Christensen
4645475800 Run goimports as part of array gen script 2017-03-20 08:00:43 -05:00
Jack Christensen
3acd3d8546 Optionally generate binary array format 2017-03-18 17:38:58 -05:00
Jack Christensen
df8f8e17cf Add pgtype.HstoreArray
This required restructuring array types to lookup oid of element instead of
hard-coding it due to hstore having a variable oid.
2017-03-18 12:40:54 -05:00
Jack Christensen
6e21cb00fe Add pgtype.Record and prerequisite restructuring
Because reading a record type requires the decoder to be able to look up oid
to type mapping and types such as hstore have types that are not fixed between
different PostgreSQL servers it was necessary to restructure the pgtype system
so all encoders and decodes take a *ConnInfo that includes oid/name/type
information.
2017-03-18 12:01:16 -05:00
Jack Christensen
666af9ead5 Name PG types as words
Though this doesn't follow Go naming conventions exactly it makes names more
consistent with PostgreSQL and it is easier to read. For example, TIDOID becomes
TidOid. In addition this is one less breaking change in the move to V3.
2017-03-11 17:03:23 -06:00
Jack Christensen
44e206ab5b Rename array files 2017-03-11 16:53:07 -06:00
Jack Christensen
2f63514c47 Move ACLItem to pgtype 2017-03-11 16:13:05 -06:00
Jack Christensen
86620c5e91 Add pgtype.ByteaArray
Also fix up quoting array elements for text arrays.
2017-03-11 13:32:32 -06:00
Jack Christensen
e654d1f0fc pgtype.Encode(Binary|Text) do not write length
To aid in composability, these methods no longer write their own length. This
is especially useful for text formatted arrays and may be useful for future
database/sql compatibility. It also makes the code a little simpler as the
types no longer have to compute their own size.

Along with this, these methods cannot encode NULL. They now return a boolean
if they are NULL. This also benefits text array encoding as numeric arrays
require NULL to be exactly `NULL` while string arrays require NULL to be
`"NULL"`.
2017-03-11 12:45:30 -06:00
Jack Christensen
bb7122d4a8 Fix typed_array_gen.sh typo 2017-03-09 21:09:36 -06:00
Jack Christensen
4254e5f2d2 Add text to pgtype 2017-03-04 21:20:56 -06:00
Jack Christensen
93e1715082 Add inet and cidr to pgtype 2017-03-04 17:33:41 -06:00
Jack Christensen
0f115477de Add float4, float8 and arrays 2017-03-04 13:29:04 -06:00
Jack Christensen
39b60605ae Add timestamp to pgtype 2017-03-04 12:36:24 -06:00
Jack Christensen
34c5070371 Add arrays to all other pgtypes 2017-03-04 11:48:53 -06:00