2760 Commits

Author SHA1 Message Date
Jack Christensen
cf8fe4a477 uuid extension switched to gofrs from satori
Do not encourage library use that has serious outstanding bug:
https://github.com/satori/go.uuid/issues/73
2019-09-14 19:58:54 -05:00
Jack Christensen
f36a695259 Merge branch 'heedson-pgtype-ext-gofrs-uuid' 2019-09-14 19:53:23 -05:00
Jack Christensen
6918e89b3a Merge branch 'pgtype-ext-gofrs-uuid' of https://github.com/heedson/pgx into heedson-pgtype-ext-gofrs-uuid 2019-09-14 19:49:30 -05:00
Jack Christensen
6e0acb04d3 Fix flickering test
--- FAIL: TestPoolWithAcquireExContextTimeoutSet (2.03s)

    conn_pool_test.go:353: Expected connection allocation time to be at least 2s, instead it was '1.999691391s'

These failures were caused by setting the timeout and then measuring how
long an acquire took.
2019-09-14 18:55:06 -05:00
Jack Christensen
99f22ac8e4 Port DSN parser from pgx v3
Original implementation: 2d9d8dc52ac211c6191c08e050c03588aa633038 by
Joshua Barone <joshua.barone@gmail.com>.

Also changed DSN tests to use "dbname" as key rather than "database" as
that is what the PostgreSQL documentation specifies. "database" still
actually works but it should not be encouraged as it is non-standard.
2019-09-14 18:37:33 -05:00
Jack Christensen
b3305b36c3
Merge pull request #598 from jbarone/master
Fixes #376
2019-09-14 18:13:01 -05:00
Artemiy Ryabinkov
17d3d592e9
add test for custom lookup func
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
2019-09-14 19:11:26 +03:00
David Hudson
d52bd74254 pgtype: Add ext type for gofrs uuid implementation
Add ext type for https://github.com/gofrs/uuid uuid type.

Change test and README from github.com/satori/go.uuid to
github.com/gofrs/uuid. The reason is due to this issue:
https://github.com/satori/go.uuid/issues/73. This was taken on board and
fixed in the community project of gofrs. The gofrs implementation has
the same interface as the original.
2019-09-13 16:50:15 +01:00
Artemiy Ryabinkov
e538885fa7
skip resolve for unix sockets
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
2019-09-13 17:52:01 +03:00
Artemiy Ryabinkov
b2ca5d8f52
validate all addresses resolved from hostname
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
2019-09-13 17:26:09 +03:00
Artemiy Ryabinkov
51cf0d5480
Merge pull request #2 from jackc/master
Sync
2019-09-13 17:20:09 +03:00
Joshua Barone
2d9d8dc52a replace dsn parser with simple parser, rather than regex 2019-09-12 10:13:13 -05:00
Jack Christensen
7d053e4d5c Replace RowsFromResultReader with ScanRow function v4.0.0-rc2 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
4952a488f2 Add more docs for Conn.Query 2019-09-10 17:35:08 -05:00
Jack Christensen
0648e1c69f Update to latest pgconn 2019-09-10 17:28:31 -05:00
Jack Christensen
f8be2b60ce go.sum changes 2019-09-10 17:25:25 -05:00
Jack Christensen
a8362ef96d Parse postgresql:// protocol 2019-09-10 17:14:04 -05:00
Jack Christensen
856c67a8c8
Merge pull request #556 from DavidArchibald/composite
Register composite types as a `pgtype.Record`.
2019-09-09 21:27:47 -05:00
David
64a0217d01 Merge branch 'master' of https://github.com/jackc/pgx into composite 2019-09-09 11:28:08 -07:00
David
fed099f04a Merge branch 'master' into composite 2019-09-09 11:26:13 -07:00
David
2d89e52d6f Add composite registering to init steps. 2019-09-09 10:52:31 -07:00
Jack Christensen
9b9d433ec5
Merge pull request #594 from ferhatelmas/v4-readme
Fix some typos
2019-09-07 10:04:21 -05:00
Jack Christensen
c32f905920
Merge pull request #581 from damour/fix_user_defined_array_type
Load user-defined array type oids.
2019-09-07 09:40:45 -05:00
ferhat elmas
912b2fcc3a Fix some typos 2019-09-04 12:46:50 +02:00
Jack Christensen
be8ed87408 Update changelog v4.0.0-rc1 2019-09-02 12:27:02 -05:00
Jack Christensen
f26e4c0e69 Update status of v4 2019-09-02 12:20:15 -05:00
Jack Christensen
f6bbf4bc3b Add package docs for pgxpool 2019-09-02 12:18:30 -05:00
Jack Christensen
afa83095a8 Add more docs 2019-09-02 12:14:04 -05:00
Jack Christensen
88e31ea5be Update url_shortener example
No need to explicitly prepare statements now that there is the statement
cache.
2019-09-02 11:58:30 -05:00
Jack Christensen
246baf2746 Update docs 2019-09-02 11:54:24 -05:00
Jack Christensen
bcea1fcd3f Update README.md 2019-09-02 11:48:48 -05:00
Jack Christensen
3b8cd87875 Remove QueryArgs
An external SQL builder like github.com/jackc/pgsql should be used
instead.
2019-09-02 09:58:11 -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
Dmitriy Garanzha
35908df25f Filter automatically created table array types. 2019-09-02 16:57:21 +03:00
Jack Christensen
0ef89ae0b7 Extract pgmock to github.com/jackc/pgmock 2019-08-31 17:07:43 -05:00
Jack Christensen
2f6b8f3f56 Fix context timeout on connect 2019-08-31 17:01:54 -05:00
Jack Christensen
2fabfa3c18 Update to newest pgproto3 2019-08-31 15:44:54 -05:00
Jack Christensen
04a0609876 Remove unused pgmock code 2019-08-31 13:13:45 -05:00
Jack Christensen
c72417a958
Merge pull request #591 from vcabbage/acquireex
Add ConnPool.AcquireEx
2019-08-31 13:01:01 -05:00
Kale Blankenship
78f498fc43 Add ConnPool.AcquireEx 2019-08-31 10:33:20 -07:00
Jack Christensen
6bba3c4810 Update pgproto3 2019-08-31 11:55:02 -05:00
Jack Christensen
53921a0a22 Allow reading a result row multiple times
refs #478
2019-08-31 10:50:14 -05:00
Jack Christensen
f20f026b7d Pool BeforeAcquire hook takes context 2019-08-31 08:57:03 -05:00
Jack Christensen
4d06b1b8ad
Merge pull request #589 from vcabbage/pool-prepare-oids
Include ParameterOIDs when preparing statements on new pool connections
2019-08-28 16:12:36 -05:00
Kale Blankenship
12c6319244 Include ParameterOIDs when preparing statements on new pool connections
ParameterOIDs passed to ConnPool.PrepareEx are used to prepare the statement
on existing connections in the pool. If additional connections are later
created ParameterOIDs are omitted, potentially causing query failures.
2019-08-28 13:07:24 -07:00
Jack Christensen
486d64daed Update pgtype and pgproto v4.0.0-pre2 2019-08-27 21:18:25 -05:00
Jack Christensen
a8802b16cc Value, EncodeBinary, EncodeText, and MarshalJSON on T instead of *T
Methods defined on T are also available on *T. This change makes Value
consistent with database/sql Value implementations. It also makes Value,
EncodeBinary, and EncodeText more convenient to use because you can
pass T or *T as an argument to a query.

The MarshalJSON change is even more significant because without it
json.Marshal would generate the "%v" format instead of the implemented
MarshalJSON.

Thought this technically changes the interface, because *T will be
automatically dereferenced as needed it shouldn't be a breaking change.

See: https://github.com/jackc/pgx/issues/538 for initial discussion.
2019-08-27 20:46:16 -05:00
Jack Christensen
4a320500cf Remove barely used ProtocolError type 2019-08-27 18:31:54 -05:00