Skip to content

Lazily retrieve data for lower memory footprint #51

@jhewlett

Description

@jhewlett

For cases where you're pulling back lots of data, it would be nice if there was a way to get back typed Records lazily to avoid hydrating all the data into memory at once. I see that there's a DataReader option, which seems like it accomplishes the lazy part, but the data is raw at that point, and as far as I can tell it doesn't generate any record types or a mapping for that option.

Basically, I want something like MapRowValues:

https://github.com/demetrixbio/FSharp.Data.Npgsql/blob/master/src/Runtime/Utils.fs#L17-L23

But without calling Seq.toList like you do in ExecuteList:

https://github.com/demetrixbio/FSharp.Data.Npgsql/blob/master/src/Runtime/ISqlCommand.fs#L202

Is there currently a way to accomplish what I want by using MapRowValues in conjunction with the DataReader option?

If not, would you be opposed to having such support? I have a few prototypes that I've been working on locally, and I would be happy to attempt a PR if I can get approval and some input into the design.

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