public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Daniele Varrazzo <[email protected]>
To: [email protected]
Subject: Re: Executing on the connection?
Date: Wed, 2 Dec 2020 07:02:28 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+mi_8Yc92bX3qhTqXq4LkGyn5VmQj6uRAcVebpqt398Tm4EJA@mail.gmail.com>
References: <CA+mi_8Yc92bX3qhTqXq4LkGyn5VmQj6uRAcVebpqt398Tm4EJA@mail.gmail.com>

On 12/2/20 3:20 AM, Daniele Varrazzo wrote:
> Hello,
> 

> 
> As a result people could use:
> 
>      conn = psycopg3.connect(dsn)
>      record = conn.execute(query, params).fetchone()
>      # or
>      for record in conn.execute(query, params):
>          ... # do something

That is what the sqlite3 module does and I find it handy.

> 
> No other methods bloating the connection interface: no executemany(),
> copy(), callproc (actually there will be no callproc at all in

Just to be clear the above(callproc excepted) or some variation of it 
will still be available off the cursor interface, correct?

> psycopg3: postgres has no fast path for function call and too much
> semantics around stored procedure that a single callproc() couldn't
> cover).
> 
> Being the cursor client-side, its close() doesn't actually do anythin
> apart from making it unusable, so just disposing of it without calling
> close() is totally safe.
> 
> Thoughts?
> 
> Cheers!
> 
> -- Daniele
> 
> 


-- 
Adrian Klaver
[email protected]





view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Executing on the connection?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox