Tweak example in readme

pgx-vs-pq
Jack Christensen 2013-07-30 18:00:17 -05:00
parent c6bf85bd63
commit ff9cab7471
1 changed files with 6 additions and 3 deletions

View File

@ -22,10 +22,13 @@ standard Scan interface. These directly return interface{}, []interface{},
map[string]interface{}, and []map[string]interface{} respectively. SelectFunc
offers custom row by row processing.
if widgets, err := conn.SelectRows("select * from widgets where type=$1", type); err != nil {
// do something with widgets
```go
if widgets, err := conn.SelectRows("select name, weight from widgets where type=$1", type); err != nil {
for w := range widgets {
fmt.Printf("%v has a weight of %v.", widgets["name"], widgets["weight"])
}
}
```
### Prepared Statements