Commit Graph

31 Commits (12857ad05b7ffa7d43eb68af9235555dbea2dc24)

Author SHA1 Message Date
Jack Christensen 12857ad05b Implement pgx.Conn.Exec in terms of pgconn.PgConn.Exec 2019-01-02 12:32:36 -06:00
Jack Christensen 1ff8024df9 Access underlying net.Conn via method
Also remove some dead code.
2018-12-31 18:00:08 -06:00
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 2e72ca854a First extraction of base.Conn 2018-11-10 18:48:43 -06:00
Jack Christensen 670e85136f Remove Conn.lastActivityTime
It was only read in one place and that was an optimization to get the
current time. Replaced that usage with time.Now()
2018-11-09 15:33:31 -06:00
Igor Novgorodov 04bead7c8a Replication: add NOEXPORT_SNAPSHOT, add GetConnInfo() func 2018-10-23 10:50:34 +02:00
steampunkcoder cba88a4b7d Fix syntax error in replication protocol message issued by StartReplication()
According to https://www.postgresql.org/docs/9.6/static/protocol-replication.html
pluginArguments should be separated by commas and surrounded by parantheses.
2018-02-05 11:12:55 -08:00
Mark Fletcher fd93b83433 Reverted breaking API change to CreateReplicationSlot. Instead, the new version that returns the consistent_point and snapshot_name values is
called CreateReplicationSlotEx().
2017-09-21 09:58:20 -07:00
Mark Fletcher a1e4b1b9b5 Changed CreateReplicationSlot to return the consistent_point and snapshot_name. 2017-09-19 21:12:15 -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 8322171bd8 Remove Rows.Fatal 2017-05-06 09:37:49 -05:00
Jack Christensen 458dd24a9f Remove unneeded WriteBuf 2017-05-02 21:39:23 -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 f04c58338b Introduce pgproto3 package
pgproto3 will wrap the message encoding and decoding for the PostgreSQL
frontend/backend protocol version 3.
2017-04-29 10:02:38 -05:00
Jack Christensen 5702f34407 Fix replication with context
The normal connection context timeout cancels the current query. That isn't
appropriate for a replication connection.
2017-03-05 14:00:38 -06:00
Jack Christensen c540b65edf Fix leaked contexts 2017-02-16 18:11:30 -06:00
Jack Christensen 11b82b3ca4 msgReader implemented in terms of ChunkReader
This should substantially reduce memory allocations and memory copies.

It also means that PostgreSQL messages are always entirely buffered in memory
before processing begins. This simplifies the message processing code.

In particular, Conn.WaitForNotification is dramatically simplified by this
change.
2017-02-13 20:45:42 -06:00
Jack Christensen deac6564ee Implement Query in terms of QueryContext
- Merge Rows.close into Rows.Close
- Merge Rows.abort into Rows.Fatal
2017-02-11 19:16:13 -06:00
Jack Christensen b8fdc38fa8 Only store Conn's *bufio.Reader in msgReader
Confusing and redundant to have the same *bufio.Reader in msgReader
and Conn.
2017-02-09 19:37:23 -06:00
Kris Wehner 1424fb2b42 Add IdentifySystem and TimelineHistory functions, and tighten up the testing 2017-01-30 11:35:48 -08:00
Kris Wehner 41d9c0f338 Add tests for replication slot drop, and go fmt 2017-01-26 18:24:21 -08:00
Kris Wehner af01afca00 Add the drop replication slot functionality 2017-01-09 14:19:08 -08:00
Kris Wehner c88c110169 ReplicationConn refactor 2017-01-09 11:32:02 -08:00
Kris Wehner cf225c8365 Add the ability to set all the fields in the constructor 2017-01-03 13:56:34 -08:00
Kris Wehner dad2c383af Start replication now wraps the sql and returns errors properly 2017-01-03 11:49:13 -08:00
Kris Wehner 2b096a7d08 It should all be unsigned. 2016-12-08 15:26:44 -08:00
Kris Wehner 14497e4c65 Capitalization 2016-12-07 21:19:58 -08:00
Kris Wehner edbd30ea6a Add replication stop mechanism 2016-12-06 15:44:37 -08:00
Kris Wehner 7bbb1c7307 Add basic logical replication protocol support 2016-12-04 21:35:22 -08:00