136 Commits

Author SHA1 Message Date
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
Jack Christensen
9b0e57c4a9 Fix panic on query error with nil stmtcache
fixes #895
2020-12-19 10:17:41 -06:00
Jack Christensen
e8f959e0e1 Add QueryFunc
refs #821
2020-12-12 09:39:58 -06:00
Jack Christensen
d4a300bd58 Fix: FieldDescriptions are available on Rows before calling Next 2020-09-05 13:24:57 -05:00
Jack Christensen
be9ceaefe6 Add native Go slice support for strings and numbers to simple protocol
[]string, []int16, []int32, []int64, []int, []uint16, []uint32,
[]uint64, []uint, []float32, and []float64 are now supported in the
simple protocol like they are in the normal usage of the extended
protocol.
2020-04-11 09:27:07 -05:00
Jack Christensen
cdec57523d Update to pgtype v1.3.0 2020-03-30 11:31:23 -05:00
Jack Christensen
95907c29ce Update pgconn and pull in fix for QueryRow with empty SQL 2020-03-07 13:27:01 -06:00
HowJMay
8e88d70eb3 fix: Fix typo
Fix some typos in codebase
2020-01-25 15:36:19 +08:00
Jack Christensen
fd4e692323 Add Rows.Values support for unknown types 2020-01-23 20:50:21 -06:00
Jack Christensen
f6feb39655 Fix Rows.Values() fallback to generic decoder
fixes #666
2020-01-23 20:41:22 -06:00
Jack Christensen
eb360b07be Tweak test for PG 12 compatibility 2019-12-23 11:08:21 -06:00
Adam Pantel
f989008ad5 Clarify error reporting in TestConnQueryErrorWhileReturningRows 2019-11-22 11:03:46 -05:00
Jack Christensen
2799739ef3 Update underlying packages to final release versions 2019-09-14 20:31:06 -05:00
Jack Christensen
7d053e4d5c Replace RowsFromResultReader with ScanRow function 2019-09-10 18:38:10 -05:00
Jack Christensen
76348773bd Make Conn.ConnInfo private 2019-09-10 18:09:21 -05:00
Jack Christensen
a8691a7066 Add RawValues to Rows 2019-09-10 17:58:24 -05:00
Jack Christensen
b5ce0220f8 Add CommandTag to Rows interface
This allows handling queries where it is unknown if there will be a
result set or not. If it is not a result set returning query the
command tag will still be available.
2019-09-02 09:53:26 -05:00
Jack Christensen
53921a0a22 Allow reading a result row multiple times
refs #478
2019-08-31 10:50:14 -05:00
Jack Christensen
8170eaf401 Update to latest version of pgconn
- Also remove a few tests of functionality that is handled by pgconn
2019-08-27 18:22:34 -05:00
Jack Christensen
6508934508 Rename PreparedStatementCache to StatementCache 2019-08-24 22:19:29 -05:00
Jack Christensen
0c3e59b07a Add automatic statement cache 2019-08-24 20:29:54 -05:00
Jack Christensen
6972a57421 pgtype.OID type should only be used for scanning and encoding values
It was a mistake to use it in other contexts. This made interop
difficult between pacakges that depended on pgtype such as pgx and
packages that did not like pgconn and pgproto3. In particular this was
awkward for prepared statements.

This is preparation for removing pgx.PreparedStatement in favor of
pgconn.PreparedStatement.
2019-08-24 13:55:57 -05:00
Jack Christensen
faa980a256 Add tests for deferred constraint errors
Port tests from v3.

Fix is implemented in pgconn f0b479097a4868d74e83c938131f5a24d25c49e8.
2019-08-06 17:17:54 -05:00
Jack Christensen
29f02807b0 Restore simple protocol support 2019-05-20 20:36:03 -05:00
Jack Christensen
c7d03eb555 Add RowsFromResultReader 2019-04-24 15:57:50 -05:00
Jack Christensen
1b8f0016e9 Split pgtype into own repo 2019-04-20 19:20:00 -05:00
Jack Christensen
efb333df6b Fix go modules
Wow. This is fun. Sure is easy to get modules wrong when upgrading a v2+
project.
2019-04-20 17:41:08 -05:00
Jack Christensen
b7e56b003a Replace lastStmtSent with pgconn support 2019-04-20 17:12:20 -05:00
Jack Christensen
5cc4796c96 Test domains when registered and unregistered
Fix bug assigning to unknown type.
2019-04-13 17:09:51 -05:00
Jack Christensen
c53c9e6eb5 Remove simple protocol and one round trip query options
It is impossible to guarantee that the a query executed with the simple
protocol will behave the same as with the extended protocol. This is
because the normal pgx path relies on knowing the OID of query
parameters. Without this encoding a value can only be determined by the
value instead of the combination of value and PostgreSQL type. For
example, how should a []int32 be encoded? It might be encoded into a
PostgreSQL int4[] or json.

Removal also simplifies the core query path.

The primary reason for the simple protocol is for servers like PgBouncer
that may not be able to support normal prepared statements. After
further research it appears that issuing a "flush" instead "sync" after
preparing the unnamed statement would allow PgBouncer to work.

The one round trip mode can be better handled with prepared statements.

As a last resort, all original server functionality can still be accessed by
dropping down to PgConn.
2019-04-13 11:39:01 -05:00