Skip to content

Remove automatic dereferencing of cursors #438

@roji

Description

@roji

While working on the read_refactor branch I came across something strange. The current Npgsql code has a feature, where if one sends a StoredProcedure query which returns a single column, and that column is a cursor, then it is "dereferenced": the cursor is traversed as if it is the result set. You can see the consumer side of this in this test.

I was wondering if there was a special reason for this feature, and whether it makes sense. It's odd to have a special case for one column (i.e. what happens if the stored procedure returns two cursors?). Also, if a stored procedure is written to return a cursor rather than a direct resultset, there's probably a reason for that and there doesn't seem to be any reason to deny the user access to the cursor (they may use it later to read only part of the resultset). We may even develop this later and add programmatic mechanisms to allow the user to traverse the cursor.

Wanted to hear if anyone has any insight on this (I'm definitely inclined to removing this special case).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions