More README tweaks

v3-ann
Jack Christensen 2017-07-21 16:35:54 -05:00
parent 79517aaa0e
commit 2e5f5e0c9d
1 changed files with 20 additions and 14 deletions

View File

@ -1,6 +1,6 @@
[![](https://godoc.org/github.com/jackc/pgx?status.svg)](https://godoc.org/github.com/jackc/pgx) [![](https://godoc.org/github.com/jackc/pgx?status.svg)](https://godoc.org/github.com/jackc/pgx)
# Pgx - PostgreSQL Driver and Toolkit # pgx - PostgreSQL Driver and Toolkit
## Version 3 Beta Branch ## Version 3 Beta Branch
@ -11,16 +11,15 @@ general release. No further changes are planned, but the beta process may
surface desirable changes. If possible API changes are acceptable, then `v3` is surface desirable changes. If possible API changes are acceptable, then `v3` is
the recommended branch for new development. the recommended branch for new development.
Pgx is a pure Go database connection library designed specifically for pgx is a pure Go driver and toolkit for PostgreSQL. pgx is different from other
PostgreSQL. Pgx is different from other drivers such as drivers such as [pq](http://godoc.org/github.com/lib/pq) because, while it can
[pq](http://godoc.org/github.com/lib/pq) because, while it can operate as a operate as a database/sql compatible driver, pgx is primarily intended to be
database/sql compatible driver, pgx is primarily intended to be used directly. used directly. It offers a native interface similar to database/sql that offers
It offers a native interface similar to database/sql that offers better better performance and more features.
performance and more features.
## Features ## Features
Pgx supports many additional features beyond what is available through database/sql. pgx supports many additional features beyond what is available through database/sql.
* pgtype package includes support for approximately 60 different PostgreSQL types - these are usable in pgx native and any database/sql PostgreSQL adapter * pgtype package includes support for approximately 60 different PostgreSQL types - these are usable in pgx native and any database/sql PostgreSQL adapter
* Batch queries * Batch queries
@ -45,13 +44,20 @@ Pgx supports many additional features beyond what is available through database/
## Performance ## Performance
Pgx performs roughly equivalent to [pq](http://godoc.org/github.com/lib/pq) and pgx performs roughly equivalent to [go-pg](https://github.com/go-pg/pg) and is
[go-pg](https://github.com/go-pg/pg) for selecting a single column from a single almost always faster than [pq](http://godoc.org/github.com/lib/pq). When parsing
row, but it is substantially faster when selecting multiple entire rows (6893 large result sets the percentage difference can be significant (16483
queries/sec for pgx vs. 3968 queries/sec for pq -- 73% faster). queries/sec for pgx vs. 10106 queries/sec for pq -- 63% faster).
See this [gist](https://gist.github.com/jackc/d282f39e088b495fba3e) for the In many use cases a significant cause of latency is network round trips between
underlying benchmark results or checkout the application and the server. pgx supports query batching to bundle multiple
queries into a single round trip. Even in the case of the fastest possible
connection, a local Unix domain socket, batching as few as three queries
together can yield an improvement of 57%. With a typical network connection the
results can be even more substantial.
See this [gist](https://gist.github.com/jackc/4996e8648a0c59839bff644f49d6e434)
for the underlying benchmark results or checkout
[go_db_bench](https://github.com/jackc/go_db_bench) to run tests for yourself. [go_db_bench](https://github.com/jackc/go_db_bench) to run tests for yourself.
## database/sql ## database/sql