Closed sberan closed 7 years ago
I think it'd be sweet to have the Cursor
emit events - I don't think it'd cause any harm at all. Good idea! And it's a backwards compatible change too which is even extra beautiful. 👏 I'd definitely accept a pull request.
See #25 :bowtie:
According to the API docs, the result from any of the
client.query(...)
variants is always a query object.However, when using a
Cursor
, the result has none of the events prescribed by the API. In fact, it is not even an event emitter. This is not a purely academic issue as querying with a cursor causes an error in newrelic instrumentation which is built around this spec.Do you agree that the
query(Cursor)
method should conform to the PG API spec by returning anEventEmitter
? If so would you accept a PR to add event emitter behavior and the emit the requiredQuery
events from theCursor
object?