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
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
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
bda10b2ec9
Rename pgtype.DataType to pgtype.Type
2022-02-21 09:01:48 -06:00
Jack Christensen
a3c351d11a
RegisterDataType now accepts *DataType
2022-02-21 08:49:04 -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
a14f3f291f
Re-enable domain type test
2022-02-12 09:35:52 -06:00
Jack Christensen
b9b5e35d0f
Convert numeric to Codec
2022-01-22 09:31:59 -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
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
Michael Darr
59fa1868a7
Support time durations for simple protocol
...
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-17 09:01:57 -05:00
Jack Christensen
9e55cff611
Fix testing Fatalf in goroutines
2021-03-06 17:21:45 -06:00
Jack Christensen
d9ac491657
Add prefer_simple_protocol option to ParseConfig
...
refs #650
2021-03-04 19:56:14 -06:00
Jack Christensen
1dc7133a63
Simplify CockroachDB detection
2021-02-27 10:40:06 -06:00
Jack Christensen
c8a7c89f15
Skip tests using pg_terminate_backend on CockroachDB
2021-02-27 09:52:51 -06:00
Jack Christensen
ec5dfb472c
Skip domain types for CockroachDB
2021-02-27 09:52:51 -06:00
Jack Christensen
a6d902777d
Skip LISTEN / NOTIFY tests for CockroachDB
2021-02-27 09:52:51 -06:00
Ethan Pailes
1df45d758d
fix stmtcache invalidation
...
This patch fixes jackc/pgx#841. The meat of the fix lives
in [a PR to the pgconn repo][1]. This change just checks
for errors after executing a prepared statement and informs
the underlying stmtcache about them so that it can properly
clean up. We don't try to get fancy with retries or anything
like that, just return the error and allow the application to handle it.
I had to make [some][1] [changes][2] to to the jackc/pgconn package as well
as this package.
Fixes #841
[1]: https://github.com/jackc/pgconn/pull/56
[2]: https://github.com/jackc/pgconn/pull/55
2020-11-12 08:15:13 -05:00
georgysavva
e29ce9f6d6
Add Config.Copy() in pgx and pgxpool packages. Conn.Config() and Pool.Config() return copy of the original config.
2020-06-02 13:35:05 +03:00
georgysavva
608451a215
Store original config in Conn before updating it.
2020-06-01 19:38:12 +03:00
Jack Christensen
ac6c49c39d
Require access to ConnString via Config
...
A Config object may be created via ParseConfig and then further
modified. Requiring access to the original ConnString via the Config
helps indicate that the Config is the source of truth as to how the
connection was actually established.
2020-05-16 18:12:04 -05:00
georgysavva
20c6c44f9f
Expose Conn.Config() and Pool.Config().
2020-05-16 19:53:08 +03:00
georgysavva
33cbec368f
rename ConnStr -> ConnString
2020-05-16 19:24:57 +03:00
georgysavva
a62de87342
Add ConnStr getter to Pool and Conn structs.
2020-05-16 18:10:29 +03:00
Jack Christensen
a66b09fbd8
Improve simple protocol / text format
...
Increased data type support for simple protocol. Improved test
coverage of simple protocol. This has the additional advantage of
exercising the text encoders and decoders.
2020-05-08 16:20:15 -05:00
malstoun
8dc8431ef9
Add arguments count check to execParamsAndPreparedPrefix
2020-01-04 12:41:49 +03:00
Adam Pantel
0a3cfab73e
Eliminate race condition in TestListenNotifyWhileBusyIsSafe
2019-11-22 11:03:33 -05:00
Jack Christensen
76348773bd
Make Conn.ConnInfo private
2019-09-10 18:09:21 -05:00
Jack Christensen
863b41aaa6
Remove unused sentinal error
2019-08-27 18:29:38 -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
a262126b5c
Replace IsAlive with IsClosed
...
IsAlive is ambiguous because the connection may be dead and we do not
know it. It implies the possibility of a ping. IsClosed is clearer -- it
does not promise the connection is alive only that it hasn't been
closed.
2019-08-24 23:49:59 -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
e9770d6ff9
Add listen / notify implemented with pgconn
...
fixes #553
2019-08-24 10:49:10 -05:00
Jack Christensen
b7b52ff079
Require conn and pool configs to be created by ParseConfig
...
This simplifies handling default values. Now there is no ambiguity
between a zero value and a default value. All default values are set by
ParseConfig and the user can modify them after the initial creation.
fixes #567
2019-08-24 09:53:38 -05:00
Jack Christensen
f3c703a102
Remove Conn SetLogger and SetLogLevel
...
Simplifying interface
2019-08-17 15:34:29 -05:00
Jack Christensen
3028821487
Add context.Context to Logger interface
...
This allows custom logger adapters to add additional fields to log
messages. For example, a HTTP server may with to log the request ID.
fixes #428
2019-08-03 16:16:21 -05:00
Jack Christensen
ab1edc79e0
Remove 0 bytes when sanitizing identifiers
...
Port of 95ea78048a
from v3.
2019-08-03 09:51:03 -05:00
Jack Christensen
29f02807b0
Restore simple protocol support
2019-05-20 20:36:03 -05:00
Jack Christensen
00d123a944
Prune methods that delegated to *pgconn.PgConn
2019-04-25 14:25:16 -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