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
- postgres v8.4.4, v9.0.1 installed both locally and on networked Windows 7
68
-
69
-
## Contributing
70
-
71
-
clone the repo:
72
-
73
-
git clone git://github.com/brianc/node-postgres
74
-
cd node-postgres
75
-
make test
76
-
77
-
And just like magic, you're ready to contribute! <3
9
+
## Examples
10
+
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
+
### Simple, using built-in client pool
20
+
21
+
var pg = require('pg');
22
+
//or native libpq bindings
23
+
//var pg = require('pg').native
24
+
25
+
var conString = "tcp://postgres:1234@localhost/postgres";
26
+
27
+
//error handling omitted
28
+
pg.connect(conString, function(err, client) {
29
+
client.query("SELECT NOW() as when", function(err, result) {
As soon as I saw node.js for the first time I knew I had found something lovely and simple and _just what I always wanted!_. So...I poked around for a while. I was excited. I still am!
106
-
107
-
I drew major inspiration from [postgres-js](http://github.com/creationix/postgres-js).
119
+
### __PLEASE__ check out the WIKI
108
120
109
-
I also drew some major inspirrado from
110
-
[node-mysql](http://github.com/felixge/node-mysql) and liked what I
111
-
saw there.
121
+
## Production Use
122
+
*[bayt.com](http://bayt.com)
112
123
113
-
### Plans for the future?
124
+
_if you use node-postgres in production and would like your site listed here, fork & add it_
114
125
115
-
- transparent prepared statement caching
116
-
- more testings of error scenarios
126
+
## Help
117
127
128
+
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.
129
+
118
130
## License
119
131
120
132
Copyright (c) 2010 Brian Carlson (brian.m.carlson@gmail.com)
0 commit comments