Permalink
Browse files

Readme beefup

Including environment variable support and how to use those to make
testing easier.  Also, link to PostgreSQL 9.1 documents, just because.

Signed-off-by: Dan Farina <drfarina@acm.org>
  • Loading branch information...
1 parent 6c7918f commit e91b0486fbdd9367065d0470c1eac598e4ff3be9 Dan Farina committed Apr 6, 2012
Showing with 20 additions and 2 deletions.
  1. +20 −2 README.md
View
@@ -20,8 +20,13 @@
**Connection String Parameters**
-These are a subset of the libpq connection parameters.
-See http://www.postgresql.org/docs/9.0/static/libpq-connect.html
+These are a subset of the libpq connection parameters. In addition, a
+number of the [environment
+variables](http://www.postgresql.org/docs/9.1/static/libpq-envars.html)
+supported by libpq are also supported. Just like libpq, these have
+lower precedence than explicitly provided connection parameters.
+
+See http://www.postgresql.org/docs/9.1/static/libpq-connect.html.
* `dbname` - The name of the database to connect to
* `user` - The user to sign in as
@@ -36,13 +41,26 @@ See http://www.postgresql.org/docs/9.0/static/libpq-connect.html
See http://golang.org/pkg/database/sql to learn how to use with `pq` through the `database/sql` package.
+## Tests
+
+`go test` is used for testing. A running PostgreSQL server is
+required, with the ability to log in. The default database to connect
+to test with is "pqgotest," but it can be overridden using environment
+variables.
+
+Example:
+
+ PGHOST=/var/run/postgresql go test pq
+
## Features
* SSL
* Handles bad connections for `database/sql`
* Scan `time.Time` correctly (i.e. `timestamp[tz]`, `time[tz]`, `date`)
* Scan binary blobs correctly (i.e. `bytea`)
* pq.ParseURL for converting urls to connection strings for sql.Open.
+* Many libpq compatible environment variables
+* Unix socket support
## Future / Things you can help with

0 comments on commit e91b048

Please sign in to comment.