28 Commits

Author SHA1 Message Date
Jack Christensen
038f263a44 Add remaining int array conversions 2019-11-27 20:23:43 -06:00
Jean-Philippe Quéméner
01ae643a48 feat: make conversion between numeric values and arrays less strict
closes https://github.com/jackc/pgx/issues/642
2019-11-26 17:11:54 +01:00
Jack Christensen
be36a7e14b Fix test and avoid change to array signatures
typed_array.go.erb was not updated back in
a8802b16cc593842f5c69b0f7cfb0de11d5cd3a8 when Value, EncodeBinary,
EncodeText, and MarshalJSON were changed to be defined on T instead of
*T. This has been corrected.
2019-11-14 20:40:41 -06:00
Andrew Huang
f517670ba5 Add tstzrange data type 2019-09-18 15:01:37 -07:00
Jack Christensen
ea65a92de9 Fix long standing text array text format null bug 2019-04-13 14:06:01 -05:00
Anthony Regeda
88d317af97 macaddr-array macaddr array is introduced 2018-09-01 16:06:20 +03:00
Anthony Regeda
5524d654d3 numeric_with_uint64 numeric array supports both types int64 and uint64 2018-04-24 16:31:31 +03:00
Iurii Krasnoshchok
91bb74b526 Add support for bpchar type 2018-01-02 12:29:40 +01:00
Jack Christensen
5ba28cf2c5 Add support for array of enum
fixes #338
2017-10-17 20:31:11 -05:00
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