Skip to content

Commit e6748b2

Browse files
committed
Update README.md
1 parent 13ba76b commit e6748b2

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

README.md

+24-29
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
[![Build Status](https://secure.travis-ci.org/brianc/node-postgres.png?branch=master)](http://travis-ci.org/brianc/node-postgres)
44

5-
PostgreSQL client for node.js. Pure JavaScript and native libpq bindings.
5+
PostgreSQL client for node.js. Pure JavaScript and optional native libpq bindings.
66

7-
## Installation
7+
## Install
88

9-
npm install pg
9+
```sh
10+
$ npm install pg
11+
```
1012

1113

1214
## Examples
@@ -34,19 +36,16 @@ pg.connect(conString, function(err, client, done) {
3436
//output: 1
3537
});
3638
});
37-
3839
```
3940

4041
[Check this out for the get up and running quickly example](https://github.com/brianc/node-postgres/wiki/Example)
4142

42-
### Simple
43+
### Client instance
4344

44-
Sometimes you may not want to use a pool of connections. You can easily connect a single client to a postgres instance, run a query, and disconnect.
45+
Sometimes you may not want to use a pool of connections. You can easily connect a single client to a postgres instance, run some queries, and disconnect.
4546

4647
```javascript
47-
var pg = require('pg');
48-
//or native libpq bindings
49-
//var pg = require('pg').native
48+
var pg = require('pg');
5049

5150
var conString = "postgres://username:password@localhost/database";
5251

@@ -67,15 +66,22 @@ client.connect(function(err) {
6766

6867
```
6968

70-
## [Documentation](https://github.com/brianc/node-postgres/wiki)
69+
## [More Documentation](https://github.com/brianc/node-postgres/wiki)
7170

7271
## Native Bindings
7372

74-
node-postgres contains a pure JavaScript driver and also exposes JavaScript bindings via libpq. You can use either interface. I personally use the JavaScript bindings as they are quite fast, and I like having everything implemented in JavaScript.
73+
To install the [native bindings](https://github.com/brianc/node-pg-native.git):
74+
75+
```sh
76+
$ npm install pg pg-native
77+
```
78+
7579

76-
To use native libpq bindings replace `require('pg')` with `require('pg').native`. If you __do not__ need or want the native bindings at all, consider using [node-postgres-pure](https://github.com/brianc/node-postgres-pure) instead which does not include them.
80+
node-postgres contains a pure JavaScript protocol implementation which is quite fast, but you can optionally use native bindings for a 20-30% increase in parsing speed. Both versions are adequate for production workloads.
7781

78-
The two share the same interface so __no other code changes should be required__. If you find yourself having to change code other than the require statement when switching from `pg` to `pg.native` or `pg.js`, please report an issue.
82+
To use the native bindings, first install [pg-native](https://github.com/brianc/node-pg-native.git). Once `pg-native` is installed, simply replace `require('pg')` with `require('pg').native`.
83+
84+
node-postgres abstracts over the [pg-native](https://github.com/brianc/node-pg-native.git) module to provide exactly the same interface as the pure JavaScript version. __No other code changes are required__. If you find yourself having to change code other than the require statement when switching from `require('pg')` to `require('pg').native` please report an issue.
7985

8086
## Features
8187

@@ -90,19 +96,18 @@ The two share the same interface so __no other code changes should be required__
9096

9197
## Contributing
9298

93-
__I love contributions.__
99+
__We love contributions!__
94100

95-
You are welcome contribute via pull requests. If you need help getting the tests running locally feel free to email me or gchat me.
101+
If you need help getting the tests running locally or have any questions about the code when working on a patch please feel free to email me or gchat me.
96102

97103
I will __happily__ accept your pull request if it:
98104
- __has tests__
99105
- looks reasonable
100106
- does not break backwards compatibility
101-
- satisfies jshint
102107

103108
Information about the testing processes is in the [wiki](https://github.com/brianc/node-postgres/wiki/Testing).
104109

105-
If you need help or have questions about constructing a pull request I'll be glad to help out as well.
110+
Open source belongs to all of us, and we're all invited to participate!
106111

107112
## Support
108113

@@ -113,16 +118,15 @@ If at all possible when you open an issue please provide
113118

114119
Usually I'll pop the code into the repo as a test. Hopefully the test fails. Then I make the test pass. Then everyone's happy!
115120

116-
117121
If you need help or run into _any_ issues getting node-postgres to work on your system please report a bug or contact me directly. I am usually available via google-talk at my github account public email address.
118122

119-
I usually tweet about any important status updates or changes to node-postgres.
123+
I usually tweet about any important status updates or changes to node-postgres on twitter.
120124
Follow me [@briancarlson](https://twitter.com/briancarlson) to keep up to date.
121125

122126

123127
## Extras
124128

125-
node-postgres is by design _low level_ with the bare minimum of abstraction. These might help out:
129+
node-postgres is by design pretty light on abstractions. These are some handy modules we've been using over the years to complete the picture:
126130

127131
- [brianc/node-pg-native](https://github.com/brianc/node-pg-native) - Simple interface abstraction on top of [libpq](https://github.com/brianc/node-libpq)
128132
- [brianc/node-pg-query-stream](https://github.com/brianc/node-pg-query-stream) - Query results from node-postgres as a readable (object) stream
@@ -138,15 +142,6 @@ node-postgres is by design _low level_ with the bare minimum of abstraction. Th
138142
- [datalanche/node-pg-format](https://github.com/datalanche/node-pg-format) - Safely and easily create dynamic SQL queries with this Node implementation of [PostgreSQL format()](http://www.postgresql.org/docs/9.3/static/functions-string.html#FUNCTIONS-STRING-FORMAT).
139143
- [iceddev/pg-transact](https://github.com/iceddev/pg-transact) - A nicer API on node-postgres transactions
140144

141-
142-
### Windows
143-
144-
1. Install Visual Studio C++ (successfully built with Express 2010). Express is free.
145-
2. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`).
146-
3. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder.
147-
4. `npm install pg`
148-
149-
150145
## License
151146

152147
Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)

0 commit comments

Comments
 (0)