Re: Executing on the connection?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, psycopg(at)postgresql(dot)org
Subject: Re: Executing on the connection?
Date: 2020-12-02 15:02:28
Message-ID: b4f9f222-fc78-1930-596b-9daf05f9d43c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2020-12-02 15:42:12 Re: Executing on the connection?
Previous Message Vladimir Ryabtsev 2020-12-02 14:49:33 Re: Executing on the connection?