Re: about client-side cursors - Mailing list psycopg

From Christophe Pettus
Subject Re: about client-side cursors
Date
Msg-id D5AD2540-1414-4C13-9794-28282C8F5620@thebuild.com
Whole thread Raw
In response to Re: about client-side cursors  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List psycopg

> On Feb 3, 2021, at 09:41, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
> Perhaps client-side cursors were invented to make it possible
> to code to the same API regardless of whether real
> (server-side) cursors are used or not ?

That's definitely part of it.

The name "cursor" for the client-side object is a bit unfortunate, but we need *something* there.  The operations are:

1. Send query to server and execute it.
2. Retrieve results from server.

Those are both asynchronous operations, and we need something to encapsulate the state to pass from #1 to #2.  You
couldjust have the connection object do that, but then we're declaring forever that we can't run two queries at the
sametime on the same connection, and that seems unwise. 

--
-- Christophe Pettus
   xof@thebuild.com




psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: about client-side cursors
Next
From: Daniele Varrazzo
Date:
Subject: Re: about client-side cursors