21 Commits

Author SHA1 Message Date
Brian C
08072a90b8
Pass options to cursor (#65)
* Bump version of pg-cursor

This includes fixes in pg-cursor@2.0.1.  I've relaxed semver a touch so I don't have to release a new version here just for patch changes to pg-cursor.

* Pass options to pg-cursor

fixes #55
2019-10-30 14:08:11 -05:00
Brian C
a84db5ffd7
Add async iterator tests (#62) 2019-10-28 12:46:49 -05:00
Brian C
c95a650a73
Upgrade dependencies (#59)
* Upgrade dependencies

- There was a security vuln with mocha, so upgraded mocha.
- Upgraded versions of node we're going to check in travis
- Switched to yarn from npm
- Removed --no-exit as that's standard mocha behavior now

* Enable postgres on newer version of travis
2019-10-28 11:58:35 -05:00
Brian C
2446fdb8d0
Fix for pg@7.5 (#47)
* Fix for pg@7.5

Don't return anything from `stream.submit`

* Add node@10 to travis version

* Relax version of node@4.x
2018-10-08 12:50:11 -05:00
Brian M. Carlson
b1f8f8d60d Eslint 2017-08-06 11:59:47 -05:00
Brian Carlson
e517b8ce14 WIP 2017-08-05 18:27:29 -05:00
Brian C
ca21462f1b Merge pull request #15 from slickmb/bug/close_race
Avoid race when stream closed while fetching
2015-11-13 10:38:18 -06:00
brianc
27bba8de04 Conform to readable stream spec
One of the tests was failing because it was testing that when a stream became readable it never returned a `null` datum on call to `stream.read()`.

In fact, when a readable stream drains it should & does return `null` for calls to `stream.read()` as described [here](https://nodejs.org/api/stream.html#stream_event_readable)

I updated the test to account for this, and they pass now.
2015-11-13 10:33:39 -06:00
matthew.blasius
d1ac31c105 Support a close callback when closing the stream 2015-11-05 16:54:12 -05:00
matthew.blasius
68819dffda Avoid race when stream closed while fetching 2015-11-05 14:09:50 -05:00
Brian M. Carlson
6ab80d3995 Add close method & supporting tests 2014-10-30 18:38:44 -04:00
Calvin Metcalf
fec090972b clean ups 2014-05-14 10:41:10 -04:00
Calvin Metcalf
41b7d7d4de fix up tests 2014-05-14 09:51:56 -04:00
Tom Buchok
87b52f9e51 adds failing test
- appears that timestamp queries emit a lot of `rows` with length == 0
- `self.once('end')` is added each of these times
- assertion on listener count shows that more than 10 listeners are applied
2014-04-09 23:56:21 -04:00
Brian M. Carlson
1961125476 Update pg-cursor
pg-cursor no longer returns the empty array 'done' signal to the callback
until the cursor recieves a readyForQuery message.  This means pg-query-stream
will not emit 'close' or 'end' events until the server is __truly__ ready for
the next query.  This fixes some race-conditions where some queries
are triggered off of the `end` event of the query-stream

closes #3
2014-03-21 11:47:32 -05:00
Brian M. Carlson
37de9c2ab0 Rebase code on top of pg-cursor 2014-02-26 09:38:16 -06:00
Brian M. Carlson
b66be5e934 Add test for stream close & satisfy stream contract 2014-02-26 07:15:01 -06:00
Brian M. Carlson
290906294d Port tests to use mocha 2014-02-26 07:11:16 -06:00
Brian M. Carlson
33be525dbb Add ability to configure highWaterMark and batchSize 2013-10-23 17:11:43 -05:00
Brian M. Carlson
1b249e9ceb Add in proper error handling 2013-10-22 13:19:28 -05:00
Brian M. Carlson
722296f8d2 Initial commit 2013-10-21 23:57:50 -05:00