Skip to content

Commit 0df516c

Browse files
committed
Add cleanup to the example
closes brianc#2
1 parent 0ebd4c3 commit 0df516c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ pg.connect(function(err, client, done) {
3434
if(err) throw err;
3535
var query = new QueryStream('SELECT * FROM generate_series(0, $1) num', [1000000])
3636
var stream = client.query(query)
37+
//release the client when the stream is finished
38+
stream.on('end', done)
3739
stream.pipe(JSONStream.stringify()).pipe(process.stdout)
3840
})
3941
```

0 commit comments

Comments
 (0)