Re: psycopg3 transactions

Поиск
Список
Период
Сортировка
От Paolo De Stefani
Тема Re: psycopg3 transactions
Дата
Msg-id 6683df3e65fe961aa478e61db7ad687d@paolodestefani.it
обсуждение исходный текст
Ответ на Re: psycopg3 transactions  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Ответы Re: psycopg3 transactions  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Re: psycopg3 transactions  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список psycopg
Il 13/10/2021 13:50 Daniele Varrazzo ha scritto:
> 
> I think we can improve the documentation there by extending more about
> the effects of the interaction between DBAPI transactions and the
> transaction() blocks. And things are definitely more intuitive if
> transaction() is used in autocommit: we might want to advise people to
> do that.
> 
> Suggestions are welcome.
> 
> -- Daniele

I think the problem is only for people like me that come from psycopg2.

I was used to wrote a "with con.cursor() as cur:" that now i hato to 
replace with:

with con.transaction():
     with con.cursor() as cur:
         cur.execute("ANY SQL STATEMENT")

and everything works as expected (or i expect...)

Thanks for clarifying

-- 
Paolo De Stefani



В списке psycopg по дате отправления:

Предыдущее
От: "Lembark, Steven"
Дата:
Сообщение: Using standard SQL placeholders in PG
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: psycopg3 transactions