Commit Graph

36 Commits (e9770d6ff9d485e539f23950fd1f9709ac481595)

Author SHA1 Message Date
Jack Christensen b7b52ff079 Require conn and pool configs to be created by ParseConfig
This simplifies handling default values. Now there is no ambiguity
between a zero value and a default value. All default values are set by
ParseConfig and the user can modify them after the initial creation.

fixes #567
2019-08-24 09:53:38 -05:00
Jack Christensen 159d82e772 Extract replication to pgxrepl package 2019-05-25 10:24:58 -05:00
Jack Christensen efb333df6b Fix go modules
Wow. This is fun. Sure is easy to get modules wrong when upgrading a v2+
project.
2019-04-20 17:41:08 -05:00
Jack Christensen 3e87a8b363 Conn.Close takes context 2019-04-10 14:56:14 -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 858d00788a Use extracted packages with Go modules 2019-04-05 10:59:47 -05:00
Jack Christensen 12857ad05b Implement pgx.Conn.Exec in terms of pgconn.PgConn.Exec 2019-01-02 12:32:36 -06:00
Jack Christensen 7f9540438c pgx uses pgconn.CommandTag instead of own definition 2019-01-01 16:55:48 -06:00
Jack Christensen c672c0d595 Use environment variables for test configuration 2018-12-30 21:52:33 -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 fe0af9b357 Happy-path batch query mode 2017-06-02 14:54:17 -05:00
Jack Christensen e4f9108e82 wip 2017-02-11 14:59:16 -06:00
Jack Christensen a9e7e3acbc Extract connection dead on server test 2017-02-04 16:03:20 -06:00
Kris Wehner c88c110169 ReplicationConn refactor 2017-01-09 11:32:02 -08:00
Jack Christensen 9d7cf39563 Fix go vet identified format strings 2016-02-15 12:32:24 -06:00
Jack Christensen f672dd2732 Remove mustPrepare from tests
Now that Query/QueryRow always prepares statements when given SQL
text there is no need to test raw SQL and prepared statements of
the same query.
2015-09-03 13:39:28 -05:00
Jack Christensen e29574d447 Add support for integer, float and text arrays
Restructure internals a bit so pgx/stdlib can turn off binary encoding and
receive text back for array types.
2014-07-26 15:03:52 -05:00
Jack Christensen c108378973 Reorganize code 2014-07-12 08:50:30 -05:00
Jack Christensen 43dcd47a92 Move to Scan interface
Remove SelectValue
2014-07-05 18:23:19 -05:00
Jack Christensen 5b345e80e1 Remove SelectValueTo
Benchmarks revealed that it is no longer performant enough to pull
its own wait. Using go_db_bench to copy JSON results to HTTP responses
it was ~20% *slower* for ~4BK responses and less than 10% faster for
+1MB responses.

The the performance problem was in io.CopyN / io.Copy. io.Copy
allocates a 32KB buffer if it doesn't have io.WriterTo or io.ReaderFrom
available. This extra alloc on every request was more expensive than
just reading the result into a string and writing it out to the response
body.

Tests indicated that if MsgReader implemented a custom Copy that used a
shared buffer it might have a few percent performance advantage. But the
additional complexity is not worth the performance gain.
2014-07-05 09:32:47 -05:00
Jack Christensen d30ef1b8b9 Replace SelectFunc with Query as core 2014-06-28 17:07:31 -05:00
Jack Christensen b6ac3ef2b0 Rename Execute to Exec 2014-06-27 14:56:27 -05:00
Jack Christensen b2c1a14fcc Update github.com/JackC to github.com/jackc 2014-06-21 08:36:20 -05:00
Jack Christensen 73b5c73c1c Do not share database connections between tests 2014-06-20 15:18:55 -05:00
Jack Christensen 4efa61bf5b Prepare returns *PreparedStatement 2014-06-20 10:47:31 -05:00
Jack Christensen f119d5221c Add CommandTag 2014-05-19 09:32:31 -05:00
Jack Christensen 1ff653ae15 Rename ConnectionParameters to ConnConfig 2014-05-17 13:38:13 -05:00
Jack Christensen 4eb597d20b Rename pgx.Connection to pgx.Conn 2014-05-17 13:11:30 -05:00
Jack Christensen 75ca2b3b1c Remove unnecessary read
* Add benchmark for SelectValueTo
2014-04-25 13:49:36 -06:00
Jack Christensen f0a3d22571 Use testing.TB interface for shared test/benchmark helpers 2013-12-10 08:25:30 -06:00
Jack Christensen c96fa440cc Test getSharedConnection handles dead connections
If a test does something that kills a connection, it previously
would break all subsequent tests that used the shared connection.
It no longer does.
2013-07-26 16:45:27 -05:00
Jack Christensen 36904168b2 Don't panic! 2013-07-20 13:07:30 -05:00
Jack Christensen 9640dc91e4 Make getSharedConnection private again 2013-07-16 08:32:49 -05:00
Jack Christensen bae49077ce Use pgx_test package for tests 2013-07-16 08:29:59 -05:00
Jack Christensen 98d4ce4c09 DRYed test and benchmark 2013-07-13 19:23:13 -05:00
Jack Christensen 8afcde41f2 Start factoring test helpers out 2013-07-13 17:29:24 -04:00