Prepared Statements integration in PsycoPG

Поиск
Список
Период
Сортировка
От Jesús Espino
Тема Prepared Statements integration in PsycoPG
Дата
Msg-id CALRMi62UhKcJ+vYs-qQxz=K+VPhfHX2FzHuyhBAWA6RhzYRe8A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Prepared Statements integration in PsycoPG  (Federico Di Gregorio <fog@initd.org>)
Список psycopg
Hi all:

I'm trying to integrate the PQprepare and PQexecPrepared methods of libpq in the psycopg, but i'm not sure what API must have in python.

My initial idea is two new methods on the cursor class:

  * prepare(statement_name, statement_query)
  * execPrepared(statement, values)

This have some extra problems like knowing the number and type of attributes expected by prepare and execPrepared, needed by the PQprepare and PQexecPrepared. One option is to add and extra parameter that receive this information, another way is parse the statement_query to extract this information, but probably must be a simplified versión of this (force types like TEXT to not explicitly defined types).

Probably another option is take the same solution to the PQexecParams.

Any idea about this? Any suggestion?

Greetings and thanks.

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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: Change License
Следующее
От: Jesús Espino
Дата:
Сообщение: Prepared Statements integration in PsycoPG