280 Commits

Author SHA1 Message Date
Jack Christensen
a0bff84d73 Merge branch 'leighhopcroft-numeric-nan-support' 2020-06-11 21:35:49 -05:00
Jack Christensen
7bcd9fbdaf Rename IsNaN to NaN 2020-06-11 21:35:32 -05:00
Jack Christensen
ee66a98ace Merge branch 'numeric-nan-support' of git://github.com/leighhopcroft/pgtype into leighhopcroft-numeric-nan-support 2020-06-11 21:29:49 -05:00
Jack Christensen
43696815c2
Merge pull request #39 from powersjcb/add-travis-config
Duplicate travis config from pgx
2020-06-11 19:45:24 -05:00
Jacob Powers
25d18b98e5 fix regression 2020-06-10 09:26:59 -07:00
Jacob Powers
de77c70f48 enable hstore extension before running tests 2020-06-10 09:05:14 -07:00
leighhopcroft
0b762c6e26 updated to use boolean IsNaN field on Numeric 2020-06-10 16:59:08 +01:00
Jacob Powers
97e4debcc0 disable test cases that require a binary sql snapshot 2020-06-10 08:27:56 -07:00
Jacob Powers
6d62aec6b1 remove irrelevant test from pgx 2020-06-09 18:31:49 -07:00
Jacob Powers
96f49eb89b copy travis configs over from pgx 2020-06-09 18:16:23 -07:00
Jacob Powers
3e586004db add travis config 2020-06-09 18:08:38 -07:00
Jack Christensen
e32805888d
Merge pull request #35 from georgysavva/scan-into-interface-dst
Make it possible to scan destination of *interface{} type.
2020-06-08 13:14:01 -05:00
georgysavva
a6d42976c6 Make it possible to scan destination of *interface{} type. 2020-06-08 13:18:54 +03:00
Jack Christensen
9b79c87d64 Update changelog 2020-06-06 10:59:27 -05:00
Jack Christensen
36944b232f Fix hstore with empty string values 2020-06-06 10:26:34 -05:00
Jack Christensen
937aec9841 Fix tests with newest pgx 2020-06-06 09:55:14 -05:00
Jack Christensen
f6355165a9 Remove superfluous argument from ScanPlan 2020-06-06 09:10:11 -05:00
Jack Christensen
91a46ce219 Clarify and normalize Value semantics
Previously, Get implicitly allowed returning a reference to an internal
value (e.g. a []byte) but AssignTo was documented as requiring a deep
copy.

This inconsistency meant that either Get was unsafe or the deep copy in
AssignTo was superfluous. In addition, Scan into a []byte skips going
through Bytea and returns a []byte of the unparsed bytes directly. i.e.
a reference not a copy.

Standardize on allowing Get and AssignTo to return internal references
but require a Value never mutate internal values - only replace them.
2020-06-06 08:34:56 -05:00
Jack Christensen
43e4070cb4 Better CompositeType and ArrayType Get implementation 2020-06-05 13:40:03 -05:00
leighhopcroft
f2a2797a88 support NaN in Numeric encode and decode methods 2020-06-02 20:14:51 +01:00
leighhopcroft
b708c8b985 support NaN in Numeric.AssignTo 2020-06-02 19:07:10 +01:00
leighhopcroft
3cbb81631a added NaN support to Numeric.Set 2020-06-02 18:35:58 +01:00
Jack Christensen
9d847241cb
Merge pull request #29 from pmorelli92/master
Add the possibility of assigning a TID to a string
2020-05-21 09:46:10 -05:00
Pablo Morelli
afff6abc6c
TID AssignTo string 2020-05-20 15:01:21 +02:00
Jack Christensen
238967ec4e Improve accuracy of numeric to float
fixes #27
2020-05-13 08:05:19 -05:00
Jack Christensen
6a1a9d05bc Add pgxtype package for simpler type registration 2020-05-13 07:34:10 -05:00
Jack Christensen
f8471ebfa8 ArrayType requires element OID 2020-05-13 07:11:10 -05:00
Jack Christensen
ee0e207ee4 CompositeType fields contain name and oid 2020-05-13 07:09:52 -05:00
Jack Christensen
0e2bc3467a Fix ext/gofrs-uuid AssignTo *uuid.UUID 2020-05-12 21:01:06 -05:00
Jack Christensen
b3e1355a46 CompositeType can assign to struct via reflection 2020-05-12 16:58:16 -05:00
Jack Christensen
9a3923b6e0 EncodeRow is superceded by CompositeFields 2020-05-12 15:51:27 -05:00
Jack Christensen
506ea36835 Do not export quoteCompositeFieldIfNeeded 2020-05-12 15:47:44 -05:00
Jack Christensen
eebc6975de Add EncodeText support for CompositeType 2020-05-12 15:45:16 -05:00
Jack Christensen
e45ef46424 Refactor and add CompositeTextBuilder 2020-05-12 15:42:26 -05:00
Jack Christensen
fcb385dccb Add ScanDecoder and ScanValue to composite scanners.
Rename Scan to Next to disambiguate.
2020-05-12 15:04:14 -05:00
Jack Christensen
e51cb1ef09 Add CompositeBinaryBuilder 2020-05-12 14:04:11 -05:00
Jack Christensen
2186634638 Add CompositeFields encoders 2020-05-12 11:55:24 -05:00
Jack Christensen
e92ee69901 Expose EnumType directly instead of behind interface 2020-05-12 10:41:50 -05:00
Jack Christensen
9cdd928cb8 CompositeType implements TypeValue 2020-05-12 10:40:13 -05:00
Jack Christensen
e5992d0aed TypeValue should include Value 2020-05-12 10:28:13 -05:00
Jack Christensen
682201a4fc Rename CloneTypeValue to NewTypeValue 2020-05-12 10:26:51 -05:00
Jack Christensen
bff2829b0f Move ComposteType.Scan functionality into AssignTo
Also remove adapter functions that are no longer used.
2020-05-12 10:19:41 -05:00
Jack Christensen
247043b597 Merge SetFields functionality into Set 2020-05-12 08:35:45 -05:00
Jack Christensen
c41160bcbb Make CompositeType status private 2020-05-12 08:01:10 -05:00
Jack Christensen
4a6bd41a36 Rename Composite to CompositeType.
This harmonizes the naming with EnumType and ArrayType.
2020-05-12 07:58:10 -05:00
Jack Christensen
036101deb5 Allow scanning to nil as no-op 2020-05-11 17:41:20 -05:00
Jack Christensen
36dbbd983d Add CompositeFields type
This adds support for the text format and removes the need for the
ScanRowValue function.
2020-05-11 17:21:21 -05:00
Jack Christensen
1b3d694469 Add ArrayType 2020-05-10 19:37:25 -05:00
Jack Christensen
6cef4638ad Update pgx dependency for tests 2020-05-10 14:11:24 -05:00
Jack Christensen
8cd94a14c7 Allow types to specify preference format result and param formats
This will be useful for array and composite types that may have to
support elements that may not support binary encoding.

It also is slightly more convenient for text-ish types to have a default
format of text.
2020-05-10 14:05:16 -05:00