165 Commits

Author SHA1 Message Date
Baptiste Fontaine
7a9e70d1e0 Fix some bad rows.Err() handlings in tests 2022-10-14 19:02:44 -05:00
Jack Christensen
0d5d8e0137 Fallback to other format when encoding query arguments
The preferred format may not be possible for certain arguments. For
example, the preferred format for numeric is binary. But if
shopspring/decimal is being used without jackc/pgx-shopspring-decimal
then it will use the database/sql/driver.Valuer interface. This will
return a string. That string should be sent in the text format.

A similar case occurs when encoding a []string into a non-text
PostgreSQL array such as uuid[].
2022-08-22 20:26:38 -05:00
Jack Christensen
ae65a8007b Use higher pgconn.FieldDescription with string Name
Instead of using pgproto3.FieldDescription through pgconn and pgx. This
lets the lowest level pgproto3 still be as memory efficient as possible.

https://github.com/jackc/pgx/pull/1281
2022-08-20 10:04:18 -05:00
Jack Christensen
2da0a11c52 Skip some examples on CockroachDB 2022-07-23 10:52:35 -05:00
Jack Christensen
4087119005 Add Conn.Query example 2022-07-23 08:24:44 -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
76946fb5a3 Replace QueryFunc with ForEachScannedRow 2022-07-07 20:29:04 -05:00
Jack Christensen
0c6266ef30 Fix scanning null did not overwrite slice 2022-04-26 14:52:01 -05:00
Jack Christensen
b72b0daa5a Add QueryRewriter interface 2022-04-23 17:26:42 -05:00
Jack Christensen
f14fb3d692 Replace interface{} with any 2022-04-09 09:12:55 -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
500c0721d7 Improve error messages for query argument encoding 2022-04-01 18:00:25 -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
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
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
1f2f239d09 Renamed pgtype.ConnInfo to pgtype.Map 2022-02-21 09:13:09 -06:00
Jack Christensen
9c5dfbdfb3 pgconn.CommandTag is now an opaque type
It now makes a copy instead of retaining driver memory. This is in
preparation to reuse the driver read buffer.
2022-02-12 10:26:26 -06:00
Jack Christensen
60da2914f3 Re-enable test 2022-02-12 09:37:12 -06:00
Jack Christensen
fcc9dcc960 Convert text to Codec
This also entailed updating and deleting types that depended on Text.
2022-01-08 13:13:26 -06:00
Jack Christensen
0c0e28a70a Convert int4 and int8 to new system
Note: purposely disabled some tests and composite support that needs to
be restored later in v5 development.
2022-01-01 17:26:39 -06:00
Jack Christensen
9fc8f9b3a8 Initial passing tests for main pgx package 2021-12-30 18:12:47 -06:00
Jack Christensen
ef2b70edad Remove github.com/gofrs/uuid test dependency 2021-12-11 14:37:02 -06:00
Jack Christensen
731312fea8 Remove github.com/shopspring/decimal test dependency 2021-12-11 14:32:32 -06:00
Jack Christensen
8c9646dbfe Remove github.com/cockroachdb/apd test dependency 2021-12-11 13:45:37 -06:00
Jack Christensen
72cc95e4dd Bump module version to v5 2021-12-11 13:29:03 -06:00
Jack Christensen
0e293b966c Finish import of pgconn 2021-12-04 14:06:57 -06:00
Jack Christensen
7e13db4538 Finish import of pgtype repo
Fix some tests that broke by merging repos
Tweak readme wording
2021-12-04 13:45:57 -06:00
Jack Christensen
cf0de913ee Use pgtype.UUID for test instead of ext UUID 2021-11-29 12:29:02 -05:00
Jack Christensen
a9f8400b01 Upgrade pgx dependency
Fix test that was comparing times directly instead of using Equal.
2021-11-20 10:20:02 -06:00
Jack Christensen
a49f4bb135 Use errors instead of golang.org/x/xerrors 2021-03-25 09:55:12 -04:00
Jack Christensen
1dc7133a63 Simplify CockroachDB detection 2021-02-27 10:40:06 -06:00
Jack Christensen
30d44c0369 Test code instead of error message for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
378bd72b67 Allow flexible number types for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
44733732e4 Skip number type sensitive test on CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
ef2adcee08 Skip number type dependent test for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
b01dd934e5 Allow different int size for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
80e7f6b0d3 Skip testing circle type on CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
c588c47ddd Skip client_encoding test for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
3a27bcd459 Skip standard_conforming_strings = off test for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
5a16bad252 Skip deferred constraint tests on CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen
5f58e0e443 Cockroach DB uses different error code 2021-02-27 09:52:51 -06:00
Jack Christensen
37884a20e7 Use testify and more forgiving numeric equality
PostgreSQL generate_series can return type int while CockroachDB always
returns bigint.
2021-02-27 09:52:51 -06:00