Re: psycopg3, prepared statements

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: psycopg3, prepared statements
Дата
Msg-id 331f273f-fc13-8d80-b209-c94c0960268b@aklaver.com
обсуждение исходный текст
Ответ на Re: psycopg3, prepared statements  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Ответы Re: psycopg3, prepared statements  (Vladimir Ryabtsev <greatvovan@gmail.com>)
Список psycopg
On 12/21/20 12:26 PM, Daniele Varrazzo wrote:
> On Mon, 21 Dec 2020 at 16:02, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 

> 
> I mistakenly replied Adrian privately. Following, his reply.
> 

> I think so. Personally, I prefer the two step approach as I am becoming
> less and less enthusiastic about hidden 'magic'. To that end a
> global(maybe connection) setting that would disable prepare would be nice.
> 
> ----
> 
> To which, 1) thank you very much, Adrian, for the plpython pointer,
> I'll take a look at it.
> 
> 2) About disabling the automatic prepare: the mechanism I have in mind
> is to set prepare_threshold to None on the connection instance;

So the above is something the user would have to do on each connection?

> however we could make sure to have the default attribute defined on
> the class: this way who really hates the idea of prepared statements
> can be cheeky and set `psycopg3.Connection.prepare_threshold = None`

I could get behind that. This all may be premature optimization on my 
part. As long as there is some way to turn it off at some level I could 
live with it.

> instead of `myconn.prepare_threshold`... More seriously, if there is a
> large base of people who think that something can go wrong with
> prepared statement we can either provide a better interface to control
> it globally or to have the feature opt-in.
> 
> 
> -- Daniele
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: psycopg3, prepared statements
Следующее
От: Vladimir Ryabtsev
Дата:
Сообщение: Re: psycopg3, prepared statements