1978 Commits

Author SHA1 Message Date
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
Jack Christensen
e2c9d2f13a Better error messages on decode* for wrong oid 2014-08-08 11:18:46 -05:00
Jack Christensen
0ddf94ef9d Add pgx.Oid serialization 2014-08-08 10:57:33 -05:00
Jack Christensen
4d4a45fc34 Fix error message for too big for int32 2014-08-08 10:39:51 -05:00
Jack Christensen
2a04433355 Fix misleading error message 2014-08-08 10:31:47 -05:00
Jack Christensen
fb55203324 Add support for varchar[] 2014-07-31 13:35:44 -05:00
Jack Christensen
56d0518e04 Add test for ConnPool.Exec 2014-07-29 17:49:13 -05:00
Jack Christensen
9b38093862 Add TLS to conn_config_test.go.example 2014-07-29 17:41:53 -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
b06d71f684 Update test to work on Windows 2014-07-26 09:50:43 -05:00
Jack Christensen
3761c6335e Ensure db is valid at end of tests 2014-07-19 17:52:36 -05:00
Jack Christensen
3144b5363f Support unknown PostgreSQL types as strings 2014-07-19 17:49:11 -05:00
Jack Christensen
6b78c7aa34 Merge prepared and unprepared tests
Because unprepared queries use the same code path as unprepared
queries now, separate tests are unnecessary.
2014-07-19 17:23:00 -05:00
Jack Christensen
61bf7d841a Always use bound parameters
PostgreSQL has two string syntaxes, one that allows backslash escapes and one
that does not (SQL standard conforming strings). By default PostgreSQL uses
standard conforming strings. QuoteString was only designed for use with
standard conforming strings. If PostgreSQL was configured with certain
combinations of the standard_conforming_strings and backslash_quote settings,
QuoteString may not correctly sanitize strings. QuoteString was only used in
unprepared queries, bound parameters are used for prepared queries.

This commit alters pgx to use always use bound parameters.

As a consequence of never doing string interpolation there is no need to have
separate Text and Binary encoders. There is now only the Encoder interface.

This change had a negative effect on the performance of simple unprepared
queries, but prepared statements should already be used for performance.

fixes #26

https://github.com/jackc/pgx/issues/26
v2.1.0
2014-07-18 16:51:11 -05:00
Jack Christensen
d57e4902a1 Update README.md
Fix markdown
Note that tern is using older pgx
2014-07-17 09:17:55 -05:00
Jack Christensen
a2a828134c Add todo CLI app example of CRUD actions 2014-07-17 09:16:13 -05:00
Jack Christensen
f7171f34e7 Add docs for pgx/stdlib v2.0.0 2014-07-14 08:16:03 -05:00
Jack Christensen
ec82bc9d1e Fix stdlib 2014-07-14 07:58:37 -05:00
Jack Christensen
ce3c76408e Tx.QueryRow implemented in terms of Tx.Query 2014-07-14 07:55:20 -05:00
Jack Christensen
1027d2d014 Fix Values when there is a null 2014-07-13 13:35:28 -05:00
Jack Christensen
a12b7ed6c1 Handle Scanning null into core types
Return error instead of panic.
2014-07-12 22:07:21 -05:00
Jack Christensen
5dace165f5 Add example custom type 2014-07-12 21:40:48 -05:00
Jack Christensen
88d5a25fc4 Fix ConnPool test 2014-07-12 21:38:08 -05:00
Jack Christensen
aff5043df9 Added a lot of documentation 2014-07-12 21:17:38 -05:00
Jack Christensen
e33fb9d5d8 Remove ConnPool functions overlapped by Stat 2014-07-12 20:12:56 -05:00
Jack Christensen
4fbd76bee5 Make MsgReader private 2014-07-12 20:08:17 -05:00
Jack Christensen
f215c8bf5f Change Scan / decodeX to use ValueReader
Also improve Rows.Scan and Rows.Values error handling.
2014-07-12 19:43:27 -05:00
Jack Christensen
70c32fadc6 Rows does not expose MsgReader 2014-07-12 11:47:10 -05:00
Jack Christensen
546a2fc670 NullX Scan check oids 2014-07-12 11:41:23 -05:00