Jack Christensen
25c2375fd8
Merge pull request #528 from kak-tus/dt
...
Support for pgtype.Date JSON marshal/unmarshal.
2019-04-24 13:12:23 -05:00
Andrey Kuzmin
b4c77819da
Use date as date, not datetime.
...
Marshal/unmarshal date without time part. Date is postgresql type without time.
2019-04-23 21:13:32 +03:00
Andrey Kuzmin
2492eae46c
Support for pgtype.Date JSON marshal/unmarshal.
...
JSON marshalling for types added on a as-needed basis.
Partly closes https://github.com/jackc/pgx/issues/310 .
2019-04-22 00:22:22 +03:00
Jack Christensen
53dd8bf77c
Travis fix
2019-04-16 21:29:41 -05:00
Jack Christensen
5044e8473a
Add SCRAM authentication
2019-04-16 20:46:57 -05:00
Jack Christensen
5c9679850f
Merge pull request #515 from fcelda/replication-allow-query
...
Allow normal queries on replication connections
2019-04-02 18:46:41 -05:00
Jack Christensen
acfac44499
Merge pull request #523 from fzerorubigd/conn-from-pool
...
[stdlib] Add support for creating a DB from pgx.Pool
2019-04-02 18:46:01 -05:00
Jan Vcelak
3e82824ff1
Enforce simple protocol on ReplicationConn
2019-04-01 12:51:03 +02:00
fzerorubigd
0b62f832b0
[stdlib] Add support for creating a DB from pgx.Pool
...
Also the configuration used in the Conn structure (used to implement the
driver.Conn interface) stores a ConnConfig which is used only for determining
if the Connection should be used with Simple Protocol or not.
2019-03-28 16:47:54 +01:00
Jan Vcelak
2e26d8df03
Document simple protocol on ReplicationConn
2019-03-25 13:47:48 +01:00
Jack Christensen
31500c15b3
Merge pull request #521 from lukedirtwalker/removeDeadCode
...
Remove unreachable code
2019-03-23 12:21:22 -05:00
Jack Christensen
9f05424fdd
Merge pull request #493 from nvorobev/rows-affected-for-copyto-copyfrom
...
Adds RowsAffected for CopyToWriter and CopyFromReader
2019-03-23 12:17:23 -05:00
Jack Christensen
862dcdf751
Merge branch 'bobheadxi-master'
2019-03-23 11:40:34 -05:00
Jack Christensen
a25c985eba
Merge branch 'master' of https://github.com/bobheadxi/pgx into bobheadxi-master
2019-03-23 11:37:16 -05:00
Jack Christensen
038060776b
Use LogLevel type instead of int for conn config
...
Technically, this is a change in the public interface. But it seems
extremely unlikely that it would cause any issues (and any that do
appear would be trivial to fix).
fixes #516
2019-03-23 11:22:47 -05:00
Jan Vcelak
bbe778863f
Remove Conn methods on ReplicationConn
...
Fixes infinite loop when any of the removed methods is called.
2019-03-18 18:52:53 +01:00
Lukas Vogel
03c00d5e41
Remove unreachable code
...
The returns can never be reached because the loop is guaranteed to return.
2019-03-18 14:20:24 +01:00
Robert Lin
0a8645df19
Remove test
2019-03-11 00:14:06 -07:00
Robert Lin
9a3e403bdf
Add rudementary enum transcode test
2019-03-11 00:07:38 -07:00
Robert Lin
e08a188515
Fix enum handling
2019-03-10 23:38:11 -07:00
Jack Christensen
051e69d512
Merge pull request #513 from sidh/issues/495
...
Fix PreferSimpleProtocol overwrite
2019-03-08 15:27:02 -06:00
Jack Christensen
fb61dbf363
Merge pull request #511 from platelk/master
...
Close issue #481 : Give access to the registered driver instance
2019-03-08 15:24:58 -06:00
Jan Vcelak
1edfd3b682
Allow normal queries on replication connections
...
The replication connection allows executing most of the SQL queries
which are available on non-replication connections.
2019-03-07 12:32:46 +01:00
Ilya Sinelnikov
8fe19f698b
Fix PreferSimpleProtocol overwrite
...
https://github.com/jackc/pgx/issues/495
2019-02-28 19:04:35 +03:00
PLATEL Kévin
74ea479b0c
Close issue #481 : Give access to the registered driver instance
...
Some library use a driver to wrap its behavior and give additional
functionality, as the datadog tracing library
("gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql")
This commit aims to give access to this instance which can't be
correctly initialized to due private fields without default values (the
configuration map inside the driver)
2019-02-05 11:01:22 +01:00
Jack Christensen
6067cfab4f
All Write errors are fatal
...
With TLS connections a Write timeout caused by a SetDeadline permanently
breaks the connection. However, the errors are reported as temporary. So
there is no way to determine if it really is recoverable. As these were
the only kind of Write error that was recovered all Write errors are now
fatal to the connection.
https://github.com/jackc/pgx/issues/494
https://github.com/jackc/pgx/issues/506
https://github.com/golang/go/issues/29971
2019-01-28 22:45:44 -06:00
Jack Christensen
4d2c112042
Merge pull request #504 from phobosxy/err-handle-verbose-oid
...
Use more detailed error output of unknown field;
2019-01-26 07:36:04 -06:00
Ilya Sivanev
a48ad29c16
Use more detailed error output of unknown field;
2019-01-21 17:51:35 +03:00
Jack Christensen
f4396b2e23
Merge pull request #500 from dgsb/master
...
support binding of []int type to array integer
2019-01-19 11:43:59 -06:00
Jack Christensen
6b154e2284
Merge pull request #501 from coder543/patch-1
...
Fix encoding of ErrorResponse
2019-01-19 11:41:23 -06:00
Josh Leverette
3f1d975e4b
Fix encoding of ErrorResponse
2019-01-17 22:19:08 -08:00
David Bariod
0c7a1fc13e
support binding of []int type to array integer
2019-01-15 11:01:18 +01:00
Jack Christensen
4618730e71
Merge pull request #491 from mialinx/master
...
More precise .pgpass handling
2018-12-15 17:11:13 -06:00
Nikolay Vorobev
a0331e7409
Adds RowsAffected for CopyToWriter and CopyFromReader
2018-12-13 12:54:42 +03:00
Dmitry Smal
af319b2c9a
More precise .pgpass handling
...
* localhost matches unix sockets too
* use OS user as default username
* use username as default database
* ignore comment lines
2018-12-11 11:46:31 +03:00
Jack Christensen
c59c9cac59
Update changelog for v3.3.0
v3.3.0
2018-12-01 11:13:13 -06:00
Jack Christensen
b5fee42f0a
Merge pull request #488 from maxarchx/master
...
Apply UUID string length check before parsing
2018-12-01 10:39:47 -06:00
Jack Christensen
f25025a580
Merge pull request #486 from yobert/master
...
Fix two minor grammatical errors in source documentation
2018-12-01 10:38:57 -06:00
Jack Christensen
5ff0ebeec6
Merge pull request #482 from fastest963/retry
...
Added LastStmtSent and use it to retry on errors if statement was not sent
2018-12-01 10:38:10 -06:00
maxarchx
b1a17cf284
Apply UUID string length check before parsing
2018-11-30 15:13:43 +05:00
Joel Jensen
41b714110a
Fix two minor grammatical errors in source documentation
2018-11-27 16:40:46 -07:00
James Hartig
6d336eccb1
Added LastStmtSent and use it to retry on errors if statement was not sent
...
Previously, a failed connection could be put back in a pool and when the
next query was attempted it would fail immediately trying to prepare the
query or reset the deadline. It wasn't clear if the Query or Exec call
could safely be retried since there was no way to know where it failed.
You can now call LastQuerySent and if it returns false then you're
guaranteed that the last call to Query(Ex)/Exec(Ex) didn't get far enough
to attempt to send the query. The call can be retried with a new
connection.
This is used in the stdlib to return a ErrBadConn if a network error
occurred and the statement was not attempted.
Fixes #427
2018-11-19 10:44:40 -05:00
Jack Christensen
bd37aaaa6a
Merge pull request #480 from gcurtis/race
...
stdlib: fix race with Driver.configs in Open
2018-11-10 07:56:43 -06:00
Greg Curtis
8b8e883961
stdlib: fix race with Driver.configs in Open
...
The Driver.configs map is protected by configMutex in
registerDriverConfig and unregisterDriverConfig, but not in Open. This
results in a race if Open is called while another goroutine is
registering/unregistering a DriverConfig.
2018-11-10 00:28:05 -08:00
Jack Christensen
a0d2ce5a0e
Merge pull request #477 from fastest963/cancel
...
Added option to customize query cancellation and wait for ready
2018-11-08 19:30:15 -06:00
James Hartig
527f404bbc
Added option to customize query cancellation and wait for ready
...
CockroachDB doesn't support 80877102 and doesn't plan to, so instead allow
the user to customize the cancellation with their own function. In our
function, we call CANCEL QUERY with the query_id based on the LocalAddr().
The WaitForReady method can be used by a pool to not put a connection back
in the pool until it is finished cancelled and ready for a new query.
2018-11-05 20:28:59 -05:00
Jack Christensen
c10ee2b7bf
Merge pull request #473 from Mic92/unix-sockets
...
Add path query parameter to support unix sockets
2018-11-05 18:58:19 -06:00
Jörg Thalheim
3410ad9122
Add host query parameter to support unix sockets
...
Currently there is no way to specify unix sockets in the connection
url. This patch adds a `host` query parameter that allows to set the path.
2018-11-03 21:07:33 +00:00
Jack Christensen
a76c2eb9c8
Merge pull request #476 from tejasmanohar/remove_tls_renegotiation_msg
...
tls: stop sending ssl_renegotiation_limit in startup message
2018-11-03 15:03:23 -05:00
Tejas Manohar
e2010c858c
tls: stop sending ssl_renegotiation_limit in startup message
...
This addresses https://github.com/jackc/pgx/issues/321 with the
fix @jackc proposed there. Redshift users that need to connect
w/ SSL currently fork the library to delete this parameter, e.g.
8e0028d742
And, that's annoying to keep up-to-date :)
2018-10-29 21:50:09 -07:00