9 Commits

Author SHA1 Message Date
Jack Christensen
6c1be9b220 Add pool configuration
MaxConns is only knob at moment
2019-04-13 18:55:02 -05:00
Jack Christensen
c53c9e6eb5 Remove simple protocol and one round trip query options
It is impossible to guarantee that the a query executed with the simple
protocol will behave the same as with the extended protocol. This is
because the normal pgx path relies on knowing the OID of query
parameters. Without this encoding a value can only be determined by the
value instead of the combination of value and PostgreSQL type. For
example, how should a []int32 be encoded? It might be encoded into a
PostgreSQL int4[] or json.

Removal also simplifies the core query path.

The primary reason for the simple protocol is for servers like PgBouncer
that may not be able to support normal prepared statements. After
further research it appears that issuing a "flush" instead "sync" after
preparing the unnamed statement would allow PgBouncer to work.

The one round trip mode can be better handled with prepared statements.

As a last resort, all original server functionality can still be accessed by
dropping down to PgConn.
2019-04-13 11:39:01 -05:00
Jack Christensen
0254279df7 Add todos for pool 2019-04-12 16:56:18 -05:00
Jack Christensen
938ee9f434 Rows and Row are now interfaces 2019-04-11 17:58:16 -05:00
Jack Christensen
3e87a8b363 Conn.Close takes context 2019-04-10 14:56:14 -05:00
Jack Christensen
54c6ddc2f0 Commit and Rollback take context
Remove Ex versions.
2019-04-10 12:22:12 -05:00
Jack Christensen
7718ee6207 Remove Ex versions of Query and QueryRow
Always require context and prepend options to arguments if necessary.
2019-04-10 12:12:22 -05:00
Jack Christensen
77a2da2b46 Replace connection pool 2019-04-10 11:09:42 -05:00
Jack Christensen
ec10fdde8b Core of new connection pool 2019-04-09 21:32:01 -05:00