Re: Executing on the connection? - Mailing list psycopg

From Karsten Hilbert
Subject Re: Executing on the connection?
Date
Msg-id X8e/Zegyktxee6Az@hermes.hilbert.loc
Whole thread Raw
In response to Re: Executing on the connection?  (Christophe Pettus <xof@thebuild.com>)
List psycopg
> > One little change I've made to psycopg3 cursors is to make it return
> > "self" on execute() (it currently returns None, so it's totally
> > unused).

+1


> > 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

+1

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Executing on the connection?
Next
From: Hagen Finley
Date:
Subject: Handling (None,) Query Results