Re: Executing on the connection? - Mailing list psycopg

From Adrian Klaver
Subject Re: Executing on the connection?
Date
Msg-id b4f9f222-fc78-1930-596b-9daf05f9d43c@aklaver.com
Whole thread Raw
In response to Executing on the connection?  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: Executing on the connection?
List psycopg
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
adrian.klaver@aklaver.com



psycopg by date:

Previous
From: Vladimir Ryabtsev
Date:
Subject: Re: Executing on the connection?
Next
From: Daniele Varrazzo
Date:
Subject: Re: Executing on the connection?