Skip to content

Returning executemany() #164

@dvarrazzo

Description

@dvarrazzo

In #163 we brushed on the idea of having executemany() returning the resulting results.

Let's explore this idea.

One possible interface already available could be Cursor.nextset(). The results might be retrieved only if the queries return TUPLES_OK: for instance INSERT... RETURNING or SELECT function() with a side effect, discarded for COMMAND_OK results.

Note that the user might accidentally consume a lot of memory if they are not aware of the feature. However it seems an unlikely occurrence. We might add a returning: bool argument to control it, but I'd be comfortable enough to default it to True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions