81 Commits

Author SHA1 Message Date
Jack Christensen
1042f095ee More pluggable value transcoding 2013-06-30 09:25:19 -05:00
Jack Christensen
d6a0f417c6 Remove unreachable panics (Go 1.1 doesn't need them) 2013-06-29 19:42:52 -05:00
Jack Christensen
73a4cfd360 Query methods sanitize arguments
fixes #18
2013-06-29 19:40:17 -05:00
Jack Christensen
be073a1c82 Refactor getBuf so it no longer needs a size 2013-06-29 17:27:54 -05:00
Jack Christensen
258cd170ce Extract txMsg 2013-06-29 17:07:54 -05:00
Jack Christensen
357e5c4735 Refactor to using bytes.Buffer 2013-06-29 16:39:07 -05:00
Jack Christensen
6339e54be4 SelectValue(s) require exactly one column 2013-06-29 13:39:35 -05:00
Jack Christensen
3acfffc142 Removed unused rxDataRowFirstValue 2013-06-29 13:24:28 -05:00
Jack Christensen
08801c2fe4 Select(Value|Row) require exactly one found row 2013-06-29 13:23:26 -05:00
Jack Christensen
aabf563a3b SelectValue and SelectRow error if no rows found
fixes #14
2013-06-29 13:10:24 -05:00
Jack Christensen
b53b014b54 DRY tests 2013-06-29 12:39:34 -05:00
Jack Christensen
6ab233c6f9 Remove ERB templating support 2013-06-29 12:09:41 -05:00
Jack Christensen
520da3a102 Use interace{} returning SelectValue(s)
Instead of SelectInt32, SelectAllString, etc.

fixes #19
2013-06-29 12:07:31 -05:00
Jack Christensen
d1fda1b21c Replace Select(type) with SelectValue
refs #19
2013-06-29 09:25:52 -05:00
Jack Christensen
9294c0ee57 Add SelectRow 2013-06-07 14:23:46 -05:00
Jack Christensen
e4e3ce0d4a Add []byte to bytea sanitization 2013-05-07 08:29:33 -05:00
Jack Christensen
e21955a1e4 Break sanitize test into multiple checks 2013-05-07 08:19:12 -05:00
Jack Christensen
ec460173eb Use rake instead of guard for erb compilation 2013-05-03 13:51:10 -05:00
Jack Christensen
3fef18bf38 Added automatic .go.erb compilation
fixes #16
2013-05-02 09:23:26 -05:00
Jack Christensen
36e4d74d30 Add DataRowReader and change Connection.SelectFunc to use it
Preparatory step for structure binding. refs #11
2013-05-01 08:51:09 -05:00
Jack Christensen
78590be058 Made many things public so SelectFunc is actually usable by others
Definitely, need to add higher level methods for other packages to
use. May rehide some of these interfaces at that point.
2013-04-26 17:06:49 -05:00
Jack Christensen
19d4a4d577 Make ConnectionParameters fields public 2013-04-23 08:57:29 -05:00
Jack Christensen
d1a56c95d2 Connect via TCP
fixes #15
2013-04-23 08:15:05 -05:00
Jack Christensen
460acd7757 Use struct instead of map[string]string for connection params 2013-04-23 08:05:05 -05:00
Jack Christensen
70e461b769 Renamed conn* to connection* 2013-04-20 11:55:13 -05:00
Jack Christensen
49e0e49ed5 DRY connection_select_value_test.go with erb 2013-04-20 11:54:06 -05:00
Jack Christensen
c1608dac53 DRY up SelectAll* tests with erb
Note: At this point erb templates must be manually evaluated; it is
not baked into the build process.
2013-04-20 11:46:17 -05:00
Jack Christensen
58ae1855cb Extract Connection.SelectAll* to own file 2013-04-20 11:34:52 -05:00
Jack Christensen
e27511a4c5 Extract Connection.Select* to own file 2013-04-20 11:30:06 -05:00
Jack Christensen
0b1ac12c0e Added basic null handling
* Connection.SelectRows leaves null values empty
* Select* and SelectAll* now error on null

refs #4
2013-04-20 11:14:01 -05:00
Jack Christensen
ee25d4a03a Rename Select to SelectFunc to conform to Go standard lib style 2013-04-19 16:35:44 -05:00
Jack Christensen
1752020d3e Update test name 2013-04-19 16:33:48 -05:00
Jack Christensen
bf86100fec Rename Query to SelectRows 2013-04-19 16:18:11 -05:00
Jack Christensen
9a5c299563 Added Select to process rows as they come over the wire
This was accomplished by promoting private query function to
public Select.

fixes #12
2013-04-19 16:10:14 -05:00
Jack Christensen
6be77b4d64 Added ConnectionPool
fixes #7
2013-04-19 15:48:57 -05:00
Jack Christensen
310c7f5fd8 go fmt 2013-04-19 15:48:45 -05:00
Jack Christensen
fa4c70907c Rename pgx.conn to pgx.Connection 2013-04-17 08:26:01 -05:00
Jack Christensen
d306d42afb Added conn.Execute to run arbitrary SQL without a result set
fixed #13
2013-04-16 20:13:06 -05:00
Jack Christensen
cbf03821e1 Revert making query methods automatically escape arguments.
Must now call SanitizeSql explicitly.

This was necessary because go supports variadic arguments but not
totally optional arguments. So it would require something to
always be passed in.
2013-04-16 19:55:01 -05:00
Jack Christensen
8392883350 Added SQL parameter sanitization
fixes #3
2013-04-15 20:22:28 -05:00
Jack Christensen
2ed4f46454 Refactored query logic so only one place has query message loop
Also combined with this refactor is multiple functions that previously
called a []string function and then casted that to the correct type
now directly read into []correcttypt.
2013-04-13 20:28:54 -05:00
Jack Christensen
2a5ad27041 go fmt 2013-04-13 20:28:45 -05:00
Jack Christensen
d2ad78b90e Added SelectAll*
fixes #2
2013-04-13 19:03:00 -05:00
Jack Christensen
8a0fa50882 Extracted Connect code from non-Connect tests 2013-04-13 18:08:45 -05:00
Jack Christensen
f977a3fe80 Added Select* for individual typed values.
fixes #1
2013-04-12 16:50:13 -05:00
Jack Christensen
3a85bae314 package name is pgx not pqx 2013-04-12 08:07:05 -05:00
Jack Christensen
1a7cf8ccc4 Added connect with md5 password 2013-04-11 21:39:44 -05:00
Jack Christensen
9e9815ae5a Added plain text password authentication 2013-04-11 21:13:47 -05:00
Jack Christensen
7683e5cfa7 go fmt 2013-04-11 21:12:02 -05:00
Jack Christensen
431b44eefe Add test for connecting as correct user 2013-04-11 20:40:06 -05:00