5 Commits

Author SHA1 Message Date
Brian C
98cd59e3e7
Return promise on cursor end (#2589)
* Return promise on cursor end

* Remove redudant if
2021-07-29 17:17:15 -05:00
Brian C
8eca181d20
Fix pg-query-stream implementation (#2051)
* Fix pg-query-stream

There were some subtle behaviors with the stream being implemented incorrectly & not working as expected with async iteration.  I've modified the code based on #2050 and comments in #2035 to have better test coverage of async iterables and update the internals significantly to more closely match the readable stream interface.

Note: this is a __breaking__ (semver major) change to this package as the close event behavior is changed slightly, and `highWaterMark` is no longer supported.  It shouldn't impact most usage, but breaking regardless.

* Remove a bunch of additional code

* Add test for destroy + error propagation

* Add failing test for destroying unsubmitted stream

* Do not throw an uncatchable error when closing an unused cursor
2019-12-29 23:08:09 -06:00
Brian M. Carlson
5a6166d0ae Fire close callback when ready for next query
Working on fixing some timing issues in pg-query-stream it uncovered an issue where the cursor is firing its 'close' callback before it's actually entirely ready to dispatch another query.  This change makes the close callback trigger when the connection re-enters `readyForQuery` state.
2019-12-26 18:36:29 +00:00
Brian M. Carlson
423baa644a Update lint rules for pg-cursor 2019-12-18 13:42:47 -06:00
Brian M. Carlson
37d15740ed Add 'packages/pg-cursor/' from commit '492fbdbb65f6f33396d1017fa4cdbbb247dd3895'
git-subtree-dir: packages/pg-cursor
git-subtree-mainline: ebb81dbfa635eca73d16d54b501f04c8d843bac5
git-subtree-split: 492fbdbb65f6f33396d1017fa4cdbbb247dd3895
2019-12-18 13:20:51 -06:00