356 Commits

Author SHA1 Message Date
Karl Seguin
a8f5ce12c5 Trying to reduce memory allocation. logQueryArgs is called even when
using the default discardLogger. This allocates quite a bit of memory.
Created a default dlogger instance and avoid logging code when that's our
logger. I couldn't think of a better implementation without touching the
Logger interface.

On 100 000 inserts, this brought the allocation down to 58MB from 122MB.
It should also result in some small performance gains.
2014-11-18 07:53:33 +07:00
Jack Christensen
d857f18454 Update changelog 2014-11-12 08:15:40 -06:00
Jack Christensen
d2ce556450 ConnPool no longer creates connections just to release them. 2014-11-12 08:11:33 -06:00
Jack Christensen
efea92e8be Fix connection pool close
Close should close successfully acquired connections, not failures.

fixes #45
2014-11-11 17:59:13 -06:00
Jack Christensen
95e9e0b308 Add example of listen/notify support
refs #43
2014-11-01 10:45:18 -05:00
Jack Christensen
f46655d849 Update changelog 2014-10-31 10:34:50 -05:00
Jack Christensen
194a077220 Add test for writing []byte to text/varchar 2014-10-31 10:33:38 -05:00
Hari Bhaskaran
161ec8db6d Support writing to postgres 'text' values from both strings as well as
[]byte. If the input is already []byte, this will avoid having the
caller convert to string and then back to []byte. Potentially saves some
allocs.
2014-10-21 12:09:51 -07:00
Jack Christensen
3beff78461 Release v2.4.0
Update changelog
v2.4.0
2014-10-03 15:00:20 -05:00
Jack Christensen
5edd660971 WaitForNotification detects lost connections quicker
Ping server every 15 seconds while waiting if no traffic has occurred.
2014-10-03 14:58:04 -05:00
Jack Christensen
d5e170cc0f Add stdlib test for []byte 2014-10-03 14:52:33 -05:00
Jack Christensen
4e51ff728f Allow reading any value into []byte 2014-09-27 15:34:52 -05:00
Jack Christensen
6a4284a30c Add test for no-op Exec 2014-09-27 14:40:13 -05:00
Jack Christensen
44f44c1baa Merge pull request #39 from anaxagoras/emptyquery
support EmptyQueryResponse message type
2014-09-27 14:37:13 -05:00
Jack Christensen
9e30e7aa93 Remove duplicate line 2014-09-27 12:20:36 -05:00
Jack Christensen
3d7974ce30 Always use keep-alive on TCP conns 2014-09-27 12:13:10 -05:00
Jack Christensen
a724d7bce6 Merge pull request #38 from anaxagoras/keepalive
Add keep-alive option
2014-09-27 12:04:17 -05:00
Andy Walker
f715715c86 add support for EmptyQueryResponse 2014-09-26 17:14:28 -04:00
Andy Walker
33fb73b8ab name consistency 2014-09-24 18:53:07 -04:00
Andy Walker
b46ee0a951 Add keep-alive option by creating a dialer first, then setting KeepAlive option 2014-09-24 18:38:15 -04:00
Jack Christensen
9c725fcb0d Merge pull request #37 from anaxagoras/master
document ParseHstore
2014-09-22 16:39:57 -05:00
Andy Walker
401fac5fa2 document ParseHstore 2014-09-22 13:22:15 -04:00
Jack Christensen
174929c406 Update obsolete documentation refs to TextEncoder and BinaryEncoder 2014-09-19 17:47:47 -05:00
Jack Christensen
f8e59bbd7d Update changelog 2014-09-19 17:41:01 -05:00
Jack Christensen
0a213e6474 Add hstore to docs 2014-09-19 17:38:35 -05:00
Jack Christensen
98853ea98f more docs 2014-09-19 17:35:00 -05:00
Jack Christensen
11a75aa29e Add tests for NullHstore 2014-09-19 17:34:02 -05:00
Jack Christensen
274a14fe73 Rename NullHstore value to Hstore
Ensure consistency with other Null* types
2014-09-19 16:35:26 -05:00
Jack Christensen
890357732b Add tests for Hstore 2014-09-19 16:30:43 -05:00
Andy Walker
2f1ec582d7 Instead of native map[string]string, use type pgx.Hstore instead 2014-09-19 15:27:15 -05:00
Andy Walker
821605a8dd Adding hstore support. map[string]string will encode to hstores and throw errors on hstores with NULL values, and there is now a NullHstore type that is basically map[string]NullString and will both accept and decode NULL values properly 2014-09-19 15:27:15 -05:00
Andy Walker
0441bcd8e4 spurious return 2014-09-19 15:27:15 -05:00
Jack Christensen
8f81acfb5f Enhance support for custom types
* Add per connection oid to name map
* Global default type format is now based on names not oids
* Add better docs for custom types
2014-09-19 15:27:15 -05:00
Jack Christensen
68034af721 Started a changelog v2.3.0 2014-09-16 16:59:13 -05:00
Brian Dunn and Jack Christensen
3e174dda8b Remove debug Println 2014-09-16 16:52:42 -05:00
Brian Dunn and Jack Christensen
a68115fc03 Fix data race with Rows and ConnPool
In an effort to reduce memory allocations, Rows was stored on the
Conn. This caused a race condition where Rows are closed and this
returns the Conn to the Pool. The Pool could then give out the Conn
again. Rows would then be reanimated and the original Rows could reclose
it.
2014-09-16 16:29:45 -05:00
Jack Christensen
a5f082fa03 Extract more error information 2014-09-15 14:52:32 -05:00
Jack Christensen
92cbc6566d Fix log truncation 2014-09-15 14:27:28 -05:00
Jack Christensen
b21a653085 Truncate logged strings and byte slices 2014-09-15 13:53:59 -05:00
Jack Christensen
5dbc03602d Improve wrong number of arguments error message for Rows.Scan
fixes #33
v2.2.0
2014-09-05 11:14:11 -05:00
Jack Christensen
f5156ac4eb discardLogger should be private 2014-09-04 16:45:35 -05:00
Jack Christensen
717ca04aa7 Remove Crit from pgx.Logger
Nothing pgx should do should generate a Crit / Fatal error (program
must terminate now). The higher level program should make those
decisions.
2014-09-04 16:40:26 -05:00
Jack Christensen
c24c28b218 Update README.md for logging 2014-09-04 16:34:25 -05:00
Jack Christensen
ff905fe862 Finish compatible interface to inconshreveable/log15 2014-09-04 16:27:40 -05:00
Jack Christensen
98109c57bb Use interface for logging instead of log15 directly 2014-09-04 16:00:53 -05:00
Jack Christensen
311c332fdc More logging 2014-09-03 11:13:29 -05:00
Jack Christensen
e47838d926 Add logging to Query 2014-09-03 10:34:45 -05:00
Jack Christensen
b8881af745 Better error when Scan fails due to unknown destination type
fixes #31
2014-09-02 16:58:10 -05:00
Jack Christensen
d28108b127 Merge pull request #29 from antonypp/patch-1
Fix bug with bulid with env: GOOS=linux GOARCH=386
2014-08-18 09:22:27 -05:00
Anton Taraev
962bb4d8cd Fix bug with bulid with env: GOOS=linux GOARCH=386
Without this fix not build with env: GOOS=linux GOARCH=386
2014-08-18 02:32:33 +04:00