Re: Executing on the connection?

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: psycopg(at)lists(dot)postgresql(dot)org, psycopg(at)postgresql(dot)org
Subject: Re: Executing on the connection?
Date: 2020-12-02 16:23:01
Message-ID: X8e/Zegyktxee6Az@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse psycopg by date

  From Date Subject
Next Message Hagen Finley 2020-12-05 15:57:06 Handling (None,) Query Results
Previous Message Daniele Varrazzo 2020-12-02 15:42:12 Re: Executing on the connection?