Audi P. Risa P
193bab416f
add RowTo(AddrOf)StructByNameLax
2023-03-25 09:57:38 -05:00
Dmitry K
e9d64ec29d
Use `time.Equal` instead of direct comparison
2023-03-24 17:51:34 -05:00
Dmitry K
2f1bba09c4
Guard deadline readings by mutex
2023-03-24 17:51:34 -05:00
Dmitry K
d829073b2f
Improve deadline simulation
2023-03-24 17:51:34 -05:00
Dmitry K
48da6435a5
Add deadline simulation
2023-03-24 17:51:34 -05:00
Dmitry K
34e3013153
Remove commented out atomic calls
2023-03-24 17:51:34 -05:00
Dmitry K
009a377028
Use mutex to guard entire `SetBlockingMode` call
2023-03-24 17:51:34 -05:00
Dmitry K
e05abb83ec
Better error messages
2023-03-24 17:51:34 -05:00
Dmitry K
89475c4c91
use `atomic.Int32` instead of `int + atomic calls`
2023-03-24 17:51:34 -05:00
Dmitry K
c3d62c8783
Small comment update 2
2023-03-24 17:51:34 -05:00
Dmitry K
1298a835bc
Small comment update
2023-03-24 17:51:34 -05:00
Dmitry K
b2b4fbcf57
Set socket to non-blocking mode in `Read`, `Flush` and `BufferReadUntilBlock` operations
2023-03-24 17:51:34 -05:00
Dmitry K
3db7d1774e
Set socket to non-blocking mode before `doneChan` is allocated to avoid that channel leaked in case when `SetBlockingMode` will return error
2023-03-24 17:51:34 -05:00
Dmitry K
a83faa67f5
Small improvements
2023-03-24 17:51:34 -05:00
Dmitry K
8b5e8d9d89
Fix Windows non-blocking I/O for CopyFrom
...
Created based on discussion here: https://github.com/jackc/pgx/pull/1525#pullrequestreview-1344511991
Fixes https://github.com/jackc/pgx/issues/1552
2023-03-24 17:51:34 -05:00
Sergej Brazdeikis
9ae852eb58
Fix typo in error message `uint32` -> `uint16`
2023-03-11 15:34:08 -06:00
Nicola Murino
19039e6dd1
fix build on 32-bit Windows
2023-03-07 17:09:03 -06:00
Dmitry K
0dbb0a52ab
Fix `realNonblockingRead`, set `realNonblockingRead` call error to `nonblockReadErr`
2023-03-04 09:25:36 -06:00
Dmitry K
087b8b2ba8
Try to make windows non-blocking I/O
2023-03-04 09:25:36 -06:00
Jack Christensen
c09ddaf440
Add Windows non-blocking IO
2023-03-04 09:25:36 -06:00
Jack Christensen
80eb6e1859
Remove sleeps in test
...
Sleeping for a microsecond on Windows actually takes 10ms. This caused
the test to never finish. Instead use channel to ensure the two
goroutines start working at the same time and remove the sleeps.
2023-02-27 20:32:51 -06:00
Jack Christensen
7ec6ee7b0a
Release v5.3.1
2023-02-27 19:57:26 -06:00
Jack Christensen
6105ca5073
Fix TestInternalNonBlockingWriteWithDeadline(t
...
The test was relying on sending so big a message that the write blocked.
However, it appears that on Windows the TCP connections over localhost
have an very large or infinite sized buffer. Change the test to simply
set the deadline to the current time before triggering the write.
2023-02-25 17:02:55 -06:00
Jack Christensen
8f46c75e73
Fix: fake non-blocking read adaptive wait time
...
If the time reached the minimum time before the 5 tries were up it
would get stuck reading 1 byte at a time indefinitely.
2023-02-25 16:45:34 -06:00
Jack Christensen
38e09bda4c
Fix *wrapSliceEncodePlan[T].Encode
...
It should pass a FlatArray[T] to the next step instead of a
anySliceArrayReflect. By using a anySliceArrayReflect, an encode of
[]github.com/google/uuid.UUID followed by []string into a PostgreSQL
uuid[] would crash. This was caused by a EncodePlan cache collision
where the second encoding used part of the cached plan of the first.
In proper usage a cache collision shouldn't be able to occur. If this
assertion proves incorrect it will be necessary to add an optional
interface to ScanPlan and EncodePlan that marks the plan as ineligable
for caching. But I have been unable to construct a failing case, and
given that ScanPlans have been cached for quite some time now without
incident I do not think it is possible. This issue only occurred due to
the bug in *wrapSliceEncodePlan[T].Encode.
https://github.com/jackc/pgx/issues/1502
2023-02-21 21:04:30 -06:00
Ch. König
9567297815
add `mgx` module reference to the readme file
2023-02-17 08:58:34 -06:00
Jack Christensen
42d327f660
Add text format jsonpath support
2023-02-14 19:52:47 -06:00
Jack Christensen
f17c743c3c
Unwatch at end of test
...
https://github.com/jackc/pgx/issues/1505
2023-02-14 09:03:41 -06:00
Jack Christensen
a6ace8969b
Fix: Prefer sql.Scanner before TryWrapScanPlanFuncs
...
This was already the case when the data type was unknown but should also
be the case when it is known.
2023-02-14 09:03:41 -06:00
Tomáš Procházka
c2e278e5d4
simplify duplicate `pgx` registration guard
...
The binary search is overkill here.
Readability first.
2023-02-13 21:08:42 -06:00
Jack Christensen
c5daa3a814
Release v5.3.0
2023-02-11 09:15:31 -06:00
Jack Christensen
f5d2da7a19
Upgrade golang.org/x/crypto and golang.org/x/text
2023-02-11 08:59:51 -06:00
Jack Christensen
b8262ace75
Upgrade to puddle v2.2.0
2023-02-11 08:57:19 -06:00
Jack Christensen
2100a64dbe
Fix broken benchmarks
2023-02-10 20:26:18 -06:00
Jack Christensen
4484831550
Prefer binary format for arrays
...
This improves performance decoding text[].
2023-02-10 20:21:25 -06:00
Jack Christensen
1f43e2e490
Fix text format array decoding with a string of "NULL"
...
It was incorrectly being treated as NULL instead of 'NULL'.
fixes https://github.com/jackc/pgx/issues/1494
2023-02-10 19:59:03 -06:00
Jack Christensen
b707faea8f
Fix flickering test TestBufferNonBlockingRead
2023-02-10 19:40:31 -06:00
Vitalii Solodilov
255f16b00f
Register pgx driver using major version
...
Fixed : #1480
2023-02-10 19:18:45 -06:00
Felix Röhrich
a47e836471
make TestPointerPointerStructScan easier to read
2023-02-10 19:06:20 -06:00
Felix Röhrich
5cd8468b99
replace erroneous reflect.New with reflect.Zero in TryWrapStructScanPlan
2023-02-10 19:06:20 -06:00
Felix Röhrich
fa5fbed497
add filter for dropped attributes in getCompositeType
2023-02-07 08:45:56 -06:00
Jack Christensen
190c05cc24
CI fix: Go versions are strings
...
Otherwise Go 1.20 was being treated as Go 1.2.
2023-02-04 07:32:13 -06:00
Jack Christensen
c875abea84
Fix encode []any to array
...
https://github.com/jackc/pgx/issues/1488
2023-02-04 07:28:52 -06:00
Jack Christensen
98543e0354
Update supported Go versions and add 1.20 to CI
2023-02-04 07:01:03 -06:00
Jack Christensen
32c29a6edd
Update issue template to use pgx v5
2023-02-01 19:40:25 -06:00
Jack Christensen
9963c32d4f
Only count when bytes actually read
2023-01-31 20:35:44 -06:00
Jack Christensen
6bc327b3ce
Find fastest possible read time for fakeNonblockingReadWaitDuration
...
The first 5 fake non-blocking reads are limited to 1 byte. This should
ensure that there is a measurement of a read where bytes are already
waiting in Go or the OS's read buffer.
2023-01-31 20:25:57 -06:00
Jack Christensen
f46d35610e
Only set c.fakeNonblockingReadWaitDuration when it will be decreased
2023-01-31 20:25:17 -06:00
Jack Christensen
cf78472ce5
Use unix build tag
...
With Go 1.19 available we can use a simpler build tag.
2023-01-31 20:10:34 -06:00
Yumin Xia
766d2bba4f
add UnmarshalJSON for pgtype Numeric
2023-01-30 21:33:02 -06:00