3211 Commits

Author SHA1 Message Date
Mukundan Kavanur Kidambi
1d7886b012 Adding UTs 2022-04-02 18:58:59 -05:00
Mukundan Kavanur Kidambi
fa2b096400 fix: Adding overall format before appending ColumnFormatCodes 2022-04-02 18:58:59 -05:00
WGH
ccb207cba5 Add support for record array
Like Record itself, it only implements BinaryDecoder,
doesn't implement BinaryEncoder, and has no support for the text
protocol.
2022-04-02 18:52:15 -05:00
WGH
3e230ba731 Split encode_binary and decode_binary in typed_array.go.erb
Again, RECORD, for example, has binary decoding, but no binary encoding.
2022-04-02 18:52:15 -05:00
WGH
5db1de5fc1 Make text format for type_array.go.erb opt-out
Some types, like RECORD, don't have sane text format. If we want to have
arrays of such types, we don't want to generate text format for such arrays
either.
2022-04-02 18:52:15 -05:00
WGH
71648e3d78 Add defaults for typed_array.go.erb template parameters
Most of the time binary_format is "true", and text_null is "NULL",
so it makes sense to not repeat that.
2022-04-02 18:52:15 -05:00
WGH
5ece2efd4c Fix typo in Record type documentation 2022-04-02 18:52:15 -05:00
Jack Christensen
8cf6721d66 Better int64 / numeric compat and text fixes v5.0.0-alpha.2 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
83e50f21e8 Extract SkipCockroachDB to pgxtest 2022-04-02 10:35:13 -05:00
Jack Christensen
e18d76b798 Initial extraction of pgxtest
- Introduce ConnTestRunner
- RunWithQueryExecModes
2022-04-02 10:26:47 -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
7b31b56de9 Reactivate CI for other DB versions 2022-03-22 20:33:24 -05:00
Jack Christensen
e04b35bfcb Make pgtype test compat with CockroachDB when possible 2022-03-22 20:33:24 -05:00
Jack Christensen
210ebb4a50 Disable incomptible test with CockroachDB 2022-03-22 20:33:24 -05:00
Jack Christensen
0fd0688d4f Alter some tests for CockroachDB 2022-03-22 20:33:24 -05:00
Jack Christensen
69580cd519 Fix a test failure 2022-03-22 20:33:24 -05:00
Jack Christensen
95c03dc9ae Unskip and fix tests 2022-03-22 20:33:24 -05:00
Jack Christensen
793eb53017 Enable test with updated error message 2022-03-22 20:33:24 -05:00
Jack Christensen
29bec2b97e Remove skipped test for scan binary to string
Receiving a binary value and encoding it back into text seems to be an
anti-pattern to may. Don't want to silently enable this. May be able to
reverse course later if necessary.
2022-03-22 20:33:24 -05:00
Jack Christensen
0cd7c757c3 Fix skipped test 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
Jens Emil Schulz Østergaard
4c6f1b1dc4 fix: add json rawmessage to typed_array_gen.sh 2022-03-21 19:15:21 -05:00
Jens Emil Schulz Østergaard
b103a6efbd test: jsonbarray set failing test cases 2022-03-21 19:15:21 -05:00
Patrick Audley
9f23ed84ba Minor typo in Changelog 2022-03-21 09:01:46 -05:00
Jack Christensen
8c18d7808b Add documentation v5.0.0-alpha.1 2022-03-19 17:01:12 -05:00
Jack Christensen
72b72b9ae9 Remove dead code 2022-03-12 15:07:32 -06:00
Jack Christensen
cb721dfb5b SendBatch supports default QueryExecMode 2022-03-12 15:06:13 -06:00
Jack Christensen
1390a11fe2 Query supports QueryExecMode
Fixed QueryExecModeExec as it must only use text format without
specifying param OIDs.
2022-03-12 14:15:39 -06:00
Jack Christensen
0c166c7620 Fix BC dates in text format 2022-03-12 12:47:01 -06:00
Jack Christensen
46966227bc Enable all QueryExecModes for exec path 2022-03-12 10:04:02 -06:00
Jack Christensen
8e341e20f3 Remove ConnConfig.BuildStatementCache 2022-03-12 09:23:40 -06:00
Jack Christensen
f27178ba85 Initial privatization of stmtcache
ConnConfig.BuildStatementCache is pending removal once connections
always have separate caches for prepared and described statements.
2022-03-12 08:35:31 -06:00
Jack Christensen
fe21cc7486 Use Map.Encode path for simple protocol 2022-03-05 21:40:49 -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
2831eedef3 Simplify copy encoding 2022-03-05 20:27:36 -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
39d2e3dc3f Move chooseParameterFormatCode 2022-03-05 15:16:12 -06:00
Jack Christensen
0d8e109c21 Test every QueryExecMode 2022-03-05 14:04:51 -06:00
Jack Christensen
aad3d65e16 Initial restructure of simple protocol to query exec mode 2022-03-05 10:27:15 -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