Jack Christensen
097b6aacb7
Add time to logging failed Exec
...
fixes #1189
2022-04-21 19:26:25 -05:00
Jack Christensen
c63f912615
Hstore.Set accepts map[string]Text
2022-04-21 19:19:32 -05:00
Jack Christensen
cc7de81d3b
Make array helpers private
2022-04-16 14:21:40 -05:00
Jack Christensen
1c90746cf5
Update CHANGELOG
2022-04-16 14:14:59 -05:00
Jack Christensen
e94cf1fbaa
Remove AcquireConn and ReleaseConn
...
Superseded by (*sql.Conn) Raw()
2022-04-16 14:07:59 -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
8b483e4223
Use generic / type safe puddle for pgxpool
2022-04-16 09:28:46 -05:00
Jack Christensen
beb4e2cfbc
SQLCODE 42501 is fatal connect error
...
Don't try fallback configs. Match libpq behavior.
fixes https://github.com/jackc/pgconn/issues/108
2022-04-16 07:26:56 -05:00
Jack Christensen
25558de3bd
Add UnmarshalJSON to pgtype.Int2
...
fixes https://github.com/jackc/pgtype/issues/153
2022-04-16 07:07:31 -05:00
Oliver Tan
90ef5bba3f
add GSSAPI authentication
...
This commit adds the GSSAPI authentication to pgx. This roughly follows
the lib/pq implementation:
* We require registering a provider to avoid mass dependency inclusions
that may not be desired (https://github.com/lib/pq/issues/971 ).
* Requires the pgproto3 package be updated. I've included my custom fork
for now.
2022-04-15 08:17:48 -05:00
Jack Christensen
b03b1666a6
Add Hijack to pgxpool.Conn
2022-04-14 11:50:12 -05:00
Oliver Tan
175856ffd3
add GSS authentication to pgproto3
2022-04-12 07:13:21 -05:00
Jack Christensen
bb8c52f7e8
Add doc regarding default pgxpool.Config.MaxConns
...
refs #1183
2022-04-11 18:49:11 -05:00
Jack Christensen
1ef2cee36e
Update changelog
2022-04-09 10:26:45 -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
95265a7421
Use Go 1.18
2022-04-09 09:11:19 -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
Matthew Gabeler-Lee
5982e4b4f8
fix detection of database does not exist error during connect
2022-04-09 07:47:59 -05:00
Mukundan Kavanur Kidambi
c6ccb4b9a3
Addressing feedback
2022-04-02 18:58:59 -05:00
Mukundan Kavanur Kidambi
e145003288
Addressing feedback
2022-04-02 18:58:59 -05:00
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
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