Commit Graph

89 Commits (b3c8a73dc7e9385888fafbd08124e8f10c69261f)

Author SHA1 Message Date
Jack Christensen b3c8a73dc7 Restructure connect process
- Moved lots of connection logic to pgconn from pgx
- Extracted pgpassfile package
2018-12-30 16:55:56 -06:00
Jack Christensen b63370e5d5 Rename base.Conn to base.PgConn
- pgx.Conn embeds base.PgConn privately
- Add pgx.Conn.ParameterStatus
2018-12-28 12:16:50 -06:00
Jack Christensen 25f21a597c Merge branch 'nvorobev-rows-affected-for-copyto-copyfrom' into v4-experimental 2018-12-15 17:26:48 -06:00
Nikolay Vorobev a0331e7409 Adds RowsAffected for CopyToWriter and CopyFromReader 2018-12-13 12:54:42 +03:00
Jack Christensen a9a178bc98 Merge branch 'master' into v4-experimental 2018-12-01 11:17:30 -06:00
Joel Jensen 41b714110a Fix two minor grammatical errors in source documentation 2018-11-27 16:40:46 -07:00
Jack Christensen 2e72ca854a First extraction of base.Conn 2018-11-10 18:48:43 -06:00
MOZGIII e4632da034
Added CheckedOutConnections for ConnPoolStat
Closes #468
2018-10-23 14:41:21 +03:00
Anthony Regeda 00d38a68a8
pool-queue-vs-stack pool should work like a queue to traverse all possible connections 2018-09-09 23:22:19 +03:00
Murat Kabilov 4e9a696434 addressing the comments
add copy methods to the Tx struct
2018-08-07 23:44:02 +03:00
Murat Kabilov 5315995dfa Add *Conn. CopyFromTextual, CopyToTextual, which use textual format for copying data 2018-07-31 08:57:53 +02:00
Gaspard Douady 9530d7fa4c ConnPool begin should not retry if ctx is done 2017-11-21 16:54:58 +01:00
Jack Christensen 23c3724fb3 Fix comment on ErrClosedPool 2017-08-29 14:53:31 -05:00
Mike Graf 30896744c8 Return ErrClosedPool when Acquire() with closed pool 2017-08-28 22:30:42 -07:00
Jack Christensen 8f4178b3d3 Use github.com/pkg/errors 2017-06-04 21:30:03 -05:00
Jack Christensen 27ab289096 Use Go casing convention for OID 2017-06-03 11:53:49 -05:00
Jack Christensen 73f496d7de Finish core batch operations 2017-06-03 11:49:27 -05:00
Jack Christensen 8a7165dd98 Add ctx to PrepareEx
Remove PrepareExContext
2017-05-20 18:03:59 -05:00
Jack Christensen d1fd222ca5 Add transaction context support 2017-05-20 17:58:19 -05:00
Jack Christensen 2a49569747 Remove AfterClose() and Conn() from Tx and Rows 2017-05-06 10:00:49 -05:00
Jack Christensen 0a67735a8e ConnPool.Close does not wait for acquired conns 2017-05-06 09:25:58 -05:00
Jack Christensen 280bce7078 Added log adapter for logrus
Also changed standard logger interface to take a map instead of varargs for
extra data.
2017-04-29 21:28:38 -05:00
Jack Christensen 7b1f461ec3 Add simple protocol suuport with (Query|Exec)Ex 2017-04-10 08:58:51 -05:00
Jack Christensen 19c6689752 Add pgtype.Record and prerequisite restructuring
Because reading a record type requires the decoder to be able to look up oid
to type mapping and types such as hstore have types that are not fixed between
different PostgreSQL servers it was necessary to restructure the pgtype system
so all encoders and decodes take a *ConnInfo that includes oid/name/type
information.
2017-03-18 12:01:16 -05:00
Jack Christensen 94749e580f Remove CopyTo 2017-03-17 14:18:25 -05:00
Jack Christensen ba5f97176a Move not null Oid to pgtype
In preparation to ConnInfo implementation.
2017-03-13 21:34:38 -05:00
Jack Christensen 743b98b298 Name PG types as words
Though this doesn't follow Go naming conventions exactly it makes names more
consistent with PostgreSQL and it is easier to read. For example, TIDOID becomes
TidOid. In addition this is one less breaking change in the move to V3.
2017-03-11 17:03:23 -06:00
Jack Christensen b1fc8109db Remove AF_INET fetching system
Also remove old encode/decode inet/cidr code. This removed some functionality
from Rows.Values, but that entire system will soon change anyway.
2017-03-04 18:00:51 -06:00
Jack Christensen 908c439317 Use stdlib context 2017-03-03 16:01:06 -06:00
Jack Christensen 7fbff4a495 Merge branch 'context' into v3-experimental 2017-02-12 15:13:47 -06:00
Jack Christensen 72b6d32e2f Extracted more context handling 2017-02-07 21:49:58 -06:00
Jack Christensen 14eedb4fca Add ConnPool context methods 2017-02-06 18:54:49 -06:00
Jack Christensen 39dad2b795 Merge branch 'master' into v3-experimental 2017-02-04 11:27:12 -06:00
Jack Christensen d398d95764 Explicitly close checked-in connections on ConnPool.Reset 2017-01-23 22:48:17 -06:00
Jack Christensen 69434056c6 Remove Conn.TxStatus 2017-01-07 14:10:11 -06:00
Jack Christensen 430d4943c7 Replace BeginIso with BeginEx
Adds support for read/write mode and deferrable modes.
2016-12-31 11:48:45 -06:00
Jack Christensen 93e5c68f69 Merge branch 'master' into v3-experimental 2016-12-10 12:21:08 -06:00
Alexander Staubo f1de186a93 Connection pool timeout should return a consistent error value so clients can test for it. 2016-10-03 15:56:01 -04:00
Martin Hamrle 9f6b99e332 Cleanups
Cleanups suggested by gometalinter tools.
2016-08-30 20:05:44 +02:00
Jack Christensen 5f7d01778e Add CopyTo to support PostgreSQL copy protocol
fixes #102
2016-08-10 16:27:44 -05:00
Jack Christensen 7e43eca3d3 Remove one allocation per pool query 2016-08-08 16:31:01 -05:00
Jack Christensen 390f75c0e1 Reduce Logger interface to Log method 2016-08-02 14:42:31 -05:00
Jack Christensen 214443deb7 Rename Oid to OID 2016-08-02 13:31:55 -05:00
Jack Christensen ecf158b086 Track and check number of in-progress acquires 2016-07-15 14:46:50 -05:00
konstantin b96777edf3 Merge branch 'Non_blocking_ConnPool_Acquire' into tmp
Conflicts:
	conn_pool.go
2016-07-06 16:58:04 +03:00
konstantin 809be4bfcb Make ConnPool.Acquire() non blocking, feedback 2016-07-06 16:22:59 +03:00
konstantin 7f9373c7c0 Make ConnPool.Acquire() non blocking
When there was an issue with DB server ConnPool.Acquire() used to block
until it heard back from the server or its OpenTimeout hit. If we had
OpenTimeout set to 3 secs, and there were X go routines trying to aquire a
connection in parallel, the very last go routine would receive timeout
error in X*OpenTimeout seconds because of the blocking nature of the
ConnPool.Acquire().

With this commit ConnPool.Acquire() is not blocking any more, and all
X requests will take about 1*OpenTimeout secs to fail.
2016-07-05 18:04:41 +03:00
Jack Christensen 40f00f4a82 Pass PrepareEx opts as pointer and DRY implementation 2016-05-20 08:30:10 -05:00
Jack Christensen b06560aa03 Rename Preparex to PrepareEx 2016-05-20 08:14:56 -05:00
William King 2ba5bb405b Slight doc update 2016-05-18 13:27:22 -07:00