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
Remove much of the 'promotional' wording
Remove 'contributors' section since it's provided by GitHub now
Simplify examples
Remove references to the connection pool
Add sections on contributing and opening issues
//queries can be executed either via text/parameter values passed as individual arguments
47
-
//or by passing an options object containing text, (optional) parameter values, and (optional) query name
48
-
client.query({
49
-
name:'insert beatle',
50
-
text:"INSERT INTO beatles(name, height, birthday) values($1, $2, $3)",
51
-
values: ['George', 70, newDate(1946, 02, 14)]
52
-
});
53
-
54
-
//subsequent queries with the same name will be executed without re-parsing the query plan by postgres
55
-
client.query({
56
-
name:'insert beatle',
57
-
values: ['Paul', 63, newDate(1945, 04, 03)]
58
-
});
59
45
var query =client.query("SELECT * FROM beatles WHERE name = $1", ['John']);
60
46
61
47
//can stream row results back 1 at a time
@@ -74,60 +60,27 @@ query.on('end', function() {
74
60
75
61
### Example notes
76
62
77
-
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.
63
+
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 when you want to handle row events as they come in.
64
+
65
+
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 within the callback function.
78
66
79
-
All examples will work with the pure javascript bindings (currently default) or the libpq native (c/c++) bindings (currently in beta)
67
+
All examples will work with the pure javascript bindings or the libpq native (c/c++) bindings
80
68
81
69
To use native libpq bindings replace `require('pg')` with `require('pg').native`.
82
70
83
71
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.
84
72
85
-
### Info
73
+
### Features
86
74
87
75
* pure javascript client and native libpq bindings share _the same api_
88
-
*_heavily_ tested
89
-
* the same suite of 200+ integration tests passed by both javascript & libpq bindings
90
-
* benchmark & long-running memory leak tests performed before releases
91
-
* tested with with
92
-
* postgres 8.x, 9.x
93
-
* Linux, OS X
94
-
* node 0.6.x & 0.8.x
95
76
* row-by-row result streaming
96
-
* built-in (optional) connection pooling
97
77
* responsive project maintainer
98
78
* supported PostgreSQL features
99
79
* parameterized queries
100
80
* named statements with query plan caching
101
-
* async notifications
102
-
* extensible js<->postgresql data-type coercion
103
-
* query queue
104
-
* active development
105
-
* fast
106
-
* close mirror of the node-mysql api for future multi-database-supported ORM implementation ease
@@ -151,6 +104,32 @@ _if you use node-postgres in production and would like your site listed here, fo
151
104
152
105
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.
153
106
107
+
## Contributing
108
+
109
+
__I love contributions.__
110
+
111
+
You are welcome contribute via pull requests. If you need help getting the tests running locally feel free to email me or gchat me.
112
+
113
+
I will __happily__ accept your pull request if it:
114
+
-_has tests_
115
+
- looks reasonable
116
+
- does not break backwards compatibility
117
+
118
+
If you need help or have questions about constructing a pull request I'll be glad to help out as well.
119
+
120
+
## Support
121
+
122
+
If at all possible when you open an issue please provide
123
+
- version of node
124
+
- version of postgres
125
+
- smallest possible snippet of code to reproduce the problem
126
+
127
+
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!
128
+
129
+
## Extras
130
+
131
+
node-postgres is by design _low level_ with the bare minimum of abstraction. You might be interested in a higher-level interface: https://github.com/grncdr/node-any-db
0 commit comments