Skip to content

Commit 2de9838

Browse files
committed
Merge remote-tracking branch 'origin/master' into libpq
Conflicts: lib/native/index.js package.json
2 parents 4c5f3ab + aec3407 commit 2de9838

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ For richer information consult the commit log on github with referenced pull req
44

55
We do not include break-fix version release in this file.
66

7+
### v3.5.0
8+
- Include support for parsing boolean arrays
9+
710
### v3.4.0
811
- Include port as connection parameter to [unix sockets](https://github.com/brianc/node-postgres/pull/604)
912
- Better support for odd [date parsing](https://github.com/brianc/node-pg-types/pull/8)

README.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ PostgreSQL client for node.js. Pure JavaScript and native libpq bindings.
88

99
npm install pg
1010

11-
### Windows
12-
13-
1. Install Visual Studio C++ (successfully built with Express 2010). Express is free.
14-
2. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`).
15-
3. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder.
16-
4. `npm install pg`
1711

1812
## Examples
1913

2014
### Client pooling
2115

22-
Typically you will access the PostgreSQL server through a pool of clients. node-postgres ships with a built in pool to help get you up and running quickly.
16+
Generally you will access the PostgreSQL server through a pool of clients. A client takes a non-trivial amount of time to establish a new connection. A client also consumes a non-trivial amount of resources on the PostgreSQL server - not something you want to do on every http request. Good news: node-postgres ships with built in client pooling.
2317

2418
```javascript
2519
var pg = require('pg');
@@ -43,6 +37,8 @@ pg.connect(conString, function(err, client, done) {
4337

4438
```
4539

40+
[Check this out for the get up and running quickly example](https://github.com/brianc/node-postgres/wiki/Example)
41+
4642
### Simple
4743

4844
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.
@@ -71,15 +67,11 @@ client.connect(function(err) {
7167

7268
```
7369

74-
## Documentation
75-
76-
Documentation is a work in progress primarily taking place on the github WIKI
77-
78-
### [Documentation](https://github.com/brianc/node-postgres/wiki)
70+
## [Documentation](https://github.com/brianc/node-postgres/wiki)
7971

8072
## Native Bindings
8173

82-
node-postgres contains a pure JavaScript driver and also exposes JavaScript bindings to libpq. You can use either interface. I personally use the JavaScript bindings as the are quite fast, and I like having everything implemented in JavaScript.
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.
8375

8476
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.
8577

@@ -103,7 +95,7 @@ __I love contributions.__
10395
You are welcome contribute via pull requests. If you need help getting the tests running locally feel free to email me or gchat me.
10496

10597
I will __happily__ accept your pull request if it:
106-
- _has tests_
98+
- _)has tests__
10799
- looks reasonable
108100
- does not break backwards compatibility
109101
- satisfies jshint
@@ -132,28 +124,25 @@ Follow me [@briancarlson](https://twitter.com/briancarlson) to keep up to date.
132124

133125
node-postgres is by design _low level_ with the bare minimum of abstraction. These might help out:
134126

127+
- [brianc/node-pg-native](https://github.com/brianc/node-pg-native) - Simple interface abstraction on top of [libpq](https://github.com/brianc/node-libpq)
135128
- [brianc/node-pg-query-stream](https://github.com/brianc/node-pg-query-stream) - Query results from node-postgres as a readable (object) stream
136129
- [brianc/node-pg-cursor](https://github.com/brianc/node-pg-cursor) - Query cursor extension for node-postgres
137130
- [brianc/node-pg-copy-streams](https://github.com/brianc/node-pg-copy-streams) - COPY FROM / COPY TO for node-postgres. Stream from one database to another, and stuff.
138131
- [brianc/node-postgres-pure](https://github.com/brianc/node-postgres-pure) - node-postgres without any of the C/C++ stuff
139132
- [brianc/node-pg-types](https://github.com/brianc/node-pg-types) - Type parsing for node-postgres
133+
- [Suor/pg-bricks](https://github.com/Suor/pg-bricks) - A higher level wrapper around node-postgres to handle connection settings, sql generation, transactions and ease data access.
140134
- [grncdr/node-any-db](https://github.com/grncdr/node-any-db) - Thin and less-opinionated database abstraction layer for node.
141135
- [brianc/node-sql](https://github.com/brianc/node-sql) - SQL generation for node.js
142136
- [hiddentao/suqel](https://hiddentao.github.io/squel/) - SQL query string builder for Javascript
143137
- [CSNW/sql-bricks](https://github.com/CSNW/sql-bricks) - Transparent, Schemaless SQL Generation
144138

145139

146-
## Production Use
147-
* [yammer.com](http://www.yammer.com)
148-
* [bayt.com](http://bayt.com)
149-
* [Vendly](http://www.vend.ly)
150-
* [SaferAging](http://www.saferaging.com)
151-
* [CartoDB](http://www.cartodb.com)
152-
* [Heap](https://heapanalytics.com)
153-
* [zoomsquare](http://www.zoomsquare.com/)
154-
* [WhenToManage](http://www.whentomanage.com)
155-
156-
_If you use node-postgres in production and would like your site listed here, fork & add it._
140+
### Windows
141+
142+
1. Install Visual Studio C++ (successfully built with Express 2010). Express is free.
143+
2. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`).
144+
3. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder.
145+
4. `npm install pg`
157146

158147

159148
## License

lib/connection.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ Connection.prototype.end = function() {
300300
this._send(0x58);
301301
};
302302

303+
Connection.prototype.close = function(msg, more) {
304+
this.writer.addCString(msg.type + (msg.name || ''));
305+
this._send(0x43, more);
306+
};
307+
303308
Connection.prototype.describe = function(msg, more) {
304309
this.writer.addCString(msg.type + (msg.name || ''));
305310
this._send(0x44, more);
@@ -364,6 +369,9 @@ Connection.prototype.parseMessage = function(buffer) {
364369
case 0x32: //2
365370
return new Message('bindComplete', length);
366371

372+
case 0x33: //3
373+
return new Message('closeComplete', length);
374+
367375
case 0x41: //A
368376
return this.parseA(buffer, length);
369377

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg",
3-
"version": "3.4.2",
3+
"version": "3.5.0",
44
"description": "PostgreSQL client - pure javascript & libpq with the same API",
55
"keywords": [
66
"postgres",
@@ -20,11 +20,11 @@
2020
"dependencies": {
2121
"buffer-writer": "1.0.0",
2222
"generic-pool": "2.1.1",
23-
"nan": "~1.3.0",
23+
"nan": "1.3.0",
2424
"packet-reader": "0.2.0",
25-
"pg-connection-string": "0.1.1",
26-
"pg-native": "1.4.0",
27-
"pg-types": "1.4.0",
25+
"pg-connection-string": "0.1.3",
26+
"pg-native": "1.4.1",
27+
"pg-types": "1.5.0",
2828
"pgpass": "0.0.3"
2929
},
3030
"devDependencies": {

0 commit comments

Comments
 (0)