474 Commits

Author SHA1 Message Date
Jack Christensen
ce378b4d9c Skip example on Cockroach DB 2022-07-23 10:21:01 -05:00
Jack Christensen
5cee04a026 Add child records docs and examples 2022-07-23 10:11:13 -05:00
Jack Christensen
3595561d9a More doc improvements 2022-07-23 09:29:25 -05:00
Jack Christensen
759e47dba3 Merge branch 'master' into v5-dev 2022-07-12 07:26:00 -05:00
Jack Christensen
d5807f01ed Restore test from v4 2022-07-12 06:57:56 -05:00
Jack Christensen
224393188d Fix InetCodec.DecodeValue 2022-07-11 08:07:23 -05:00
Jack Christensen
e7eb8a3250 Use netip package for representing inet and cidr types 2022-07-10 14:31:55 -05:00
Jack Christensen
7974a102fc Improve Scan error messages 2022-07-09 21:47:39 -05:00
Jack Christensen
b662ab6767 Better encode error message 2022-07-09 21:40:44 -05:00
Jack Christensen
90c2dc6f68 Rename ForEachScannedRow to ForEachRow 2022-07-09 16:47:28 -05:00
Jack Christensen
76946fb5a3 Replace QueryFunc with ForEachScannedRow 2022-07-07 20:29:04 -05:00
Jack Christensen
82ca09e645 Numeric infinity only supported on PG 14+
Move to PG 14+ specific test
2022-06-25 13:33:09 -05:00
Jack Christensen
c0a4d1b9ce Add a few tests 2022-06-20 20:43:56 -05:00
Jack Christensen
989a4835de Remove rune to text conversion
Because rune is an alias for int32 this caused some very surprising
results. e.g. inserting int32(65) into text would insert "A" instead of
"65".
2022-05-12 17:13:49 -05:00
Jack Christensen
01190e5d78 Update ScanPlan.Scan documentation 2022-04-30 08:29:51 -05:00
Jack Christensen
0c6266ef30 Fix scanning null did not overwrite slice 2022-04-26 14:52:01 -05:00
Jack Christensen
7427820aba Scan binary UUID to string
https://github.com/jackc/pgx/issues/1191
2022-04-26 08:37:10 -05:00
Jack Christensen
f9857b73d9 Skip multirange tests on PG < 14 2022-04-23 16:55:24 -05:00
Jack Christensen
dfb681d716 Build / rewrite / port multirange support 2022-04-23 12:50:18 -05:00
Jack Christensen
126b582f19 Make range helpers private 2022-04-23 11:10:04 -05:00
Jack Christensen
cb45e85954 Merge remote-tracking branch 'pgtype/master' into v5-dev 2022-04-23 11:00:07 -05:00
Jack Christensen
468b793282 Skip tests with unsupported types on CockroachDB 2022-04-23 10:34:53 -05:00
Jack Christensen
cc7de81d3b Make array helpers private 2022-04-16 14:21:40 -05:00
Jack Christensen
a01a9ee6df Automatically register Array and FlatArray 2022-04-16 14:04:25 -05:00
Jack Christensen
fccaebc93d Add pgtype.Map.SQLScanner
This enables compatibility with database/sql for types that cannot
implement Scan themselves.
2022-04-16 13:38:27 -05:00
Jack Christensen
f1a4ae3070 Add Array and FlatArray container types 2022-04-16 11:33:45 -05:00
Jack Christensen
d4abe83edb Revert use generics for RangeCodec
Reverted almost all of 976b1e0.

Still may consider a way to get DecodeValue to be strongly typed but
that feature isn't worth the complications of generics. Especially in
that applying this style to ArrayCodec would make Conn.LoadType
impossible for arrays.
2022-04-16 10:39:12 -05:00
Jack Christensen
976b1e03a9 Use generics for RangeCodec
This allows DecodeValue to return a more strongly typed value.
2022-04-09 10:21:17 -05:00
Jack Christensen
c8025fd79a Use generics for Range values 2022-04-09 09:34:37 -05:00
Jack Christensen
f14fb3d692 Replace interface{} with any 2022-04-09 09:12:55 -05:00
Jack Christensen
829babcea9 Better number to string handling
Avoid ambiguity of stringWrapper implementing Int64Scanner and
Float64Scanner.
2022-04-09 09:09:46 -05:00
Jack Christensen
8cf6721d66 Better int64 / numeric compat and text fixes 2022-04-02 16:55:05 -05:00
Jack Christensen
53ec52aa17 Fix out of date pgtype/int_test.go.erb 2022-04-02 14:41:33 -05:00
Jack Christensen
ee93440ac1 pgtype uses pgxtest
Added ValueRoundTripTest to pgxtest
Removed pgtype/testutil

pgtype tests now run with all (applicable) query modes. This gives
better coverage than before and revealed several bugs which are also
fixed in this commit.
2022-04-02 14:34:19 -05:00
Jack Christensen
e392908c72 Remove Int64Valuer implementation from stringWrapper 2022-04-02 08:24:55 -05:00
Jack Christensen
500c0721d7 Improve error messages for query argument encoding 2022-04-01 18:00:25 -05:00
Jack Christensen
3a6d9490e5 Only test numeric infinity on PG 14+ 2022-03-26 11:38:31 -05:00
Jack Christensen
600c4fd931 Skip test for Cockroach CI 2022-03-22 20:44:17 -05:00
Jack Christensen
103dfe145e Test should always close rows 2022-03-22 20:41:05 -05:00
Jack Christensen
e04b35bfcb Make pgtype test compat with CockroachDB when possible 2022-03-22 20:33:24 -05:00
Jack Christensen
be5a6cc9c0 Remove obsolete test 2022-03-22 20:33:24 -05:00
Jack Christensen
5ca048ed2d Fix crash with pointer to nil struct 2022-03-22 20:33:24 -05:00
Jack Christensen
8c18d7808b Add documentation 2022-03-19 17:01:12 -05:00
Jack Christensen
0c166c7620 Fix BC dates in text format 2022-03-12 12:47:01 -06:00
Jack Christensen
c4b08378f2 Handle driver.Valuers inside Map.Encode 2022-03-05 21:27:17 -06:00
Jack Christensen
0905d1f452 Register more default types and handle unknown types better 2022-03-05 21:19:58 -06:00
Jack Christensen
e5685a34fc Simplify encoding extended query arguments 2022-03-05 20:16:57 -06:00
Jack Christensen
1cef9075d9 Simply typed nil and driver.Valuer handling
* Convert typed nils to untyped nils at beginning of encoding process.
* Restore v4 json/jsonb null behavior
* Add anynil internal package
2022-03-05 19:53:59 -06:00
Jack Christensen
2885b039d5 Rename Uint32 field to include bit size
i.e. Uint renamed to Uint32. This matches the pattern set by the
database/sql types.
2022-03-05 09:23:25 -06:00
Jack Christensen
84a3d91322 pgtype Float4 and Float8 fields include bit size
e.g. Instead of Float it is Float64. This matches the pattern set by the
database/sql types.
2022-03-05 09:20:03 -06:00