Skip to content

PG Adapter Presently Only Fakes Streaming #251

@danfinlay

Description

@danfinlay

I was processing a pretty big dataset the other day, and naturally was feeling pretty grateful that Model supports streaming results, until der_On and I discovered:

The PG Adapter Only Fakes Streaming!

My shocked face

It inherits from EventedQueryProcessor, which inherits from an EventEmitter, and only fakes a Stream object, but without the critical back-pressure handling and memory-efficiency of actual streams!

You can see an example of how this is presently implemented here.

One good reason this may have been done originally, is that the core PG module does not support streams.

Fortunately, there is a module, node-pg-query-stream that does exactly what we need here.

I'm adding this issue to help guide efforts at adding proper streaming to the PG adapter, and am going to be taking a shot myself, although this will definitely be the deepest I've ever delved into Model, so no promises! (Only callbacks)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions