You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,16 @@
1
1
#node-postgres
2
2
3
-
Non-blocking PostgreSQL client for node.js. Pure JavaScript and native libpq bindings.
3
+
Non-blocking PostgreSQL client for node.js. Pure JavaScript and native libpq bindings. Active development, well tested, and production use.
4
4
5
5
## Installation
6
6
7
7
npm install pg
8
+
9
+
### notice
10
+
node-postgres compiles native bindings when you install. The native bindings do not _currently_ compile with node v0.5.x. I'm working on support for v0.5.x. In the mean time if you get a compilation failure during installation you have still successfully installed the module; however, you cannot use the native bindings -- only the pure javascript bindings.
8
11
9
12
## Examples
10
13
11
-
All examples will work with the pure javascript bindings (currently default) or the libpq native (c/c++) bindings (currently in beta)
12
-
13
-
To use native libpq bindings replace `require('pg')` with `require('pg').native`.
14
-
15
-
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`, please report an issue.
16
-
17
-
node-postgres supports both an 'event emitter' style API and a 'callback' style. The callback style is more concise and generally preferred, but the evented API can come in handy. They can be mixed and matched. The only events which do __not__ fire when callbacks are supplied are the `error` events, as they are to be handled by the callback function.
18
-
19
14
### Simple, using built-in client pool
20
15
21
16
var pg = require('pg');
@@ -73,9 +68,19 @@ node-postgres supports both an 'event emitter' style API and a 'callback' style.
73
68
client.end();
74
69
});
75
70
71
+
### Example notes
72
+
73
+
node-postgres supports both an 'event emitter' style API and a 'callback' style. The callback style is more concise and generally preferred, but the evented API can come in handy. They can be mixed and matched. The only events which do __not__ fire when callbacks are supplied are the `error` events, as they are to be handled by the callback function.
74
+
75
+
All examples will work with the pure javascript bindings (currently default) or the libpq native (c/c++) bindings (currently in beta)
76
+
77
+
To use native libpq bindings replace `require('pg')` with `require('pg').native`.
78
+
79
+
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`, please report an issue.
80
+
76
81
### Info
77
82
78
-
*a pure javascript client and native libpq bindings with_the same api_
83
+
* pure javascript client and native libpq bindings share_the same api_
79
84
*_heavily_ tested
80
85
* the same suite of 200+ integration tests passed by both javascript & libpq bindings
81
86
* benchmark & long-running memory leak tests performed before releases
@@ -84,7 +89,7 @@ node-postgres supports both an 'event emitter' style API and a 'callback' style.
84
89
* Linux, OS X
85
90
* node 2.x & 4.x
86
91
* row-by-row result streaming
87
-
*optional, built-in connection pooling
92
+
* built-in (optional) connection pooling
88
93
* responsive project maintainer
89
94
* supported PostgreSQL features
90
95
* parameterized queries
@@ -94,9 +99,7 @@ node-postgres supports both an 'event emitter' style API and a 'callback' style.
94
99
* query queue
95
100
* active development
96
101
* fast
97
-
* No dependencies (other than PostgreSQL)
98
-
* No monkey patching
99
-
* Tried to mirror the node-mysql api as much as possible for future multi-database-supported ORM implementation ease
102
+
* close mirror of the node-mysql api for future multi-database-supported ORM implementation ease
100
103
101
104
### Contributors
102
105
@@ -109,15 +112,23 @@ Many thanks to the following:
0 commit comments