Prepared Statements integration in PsycoPG

From: Jesús Espino <jespinog(at)gmail(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: Prepared Statements integration in PsycoPG
Date: 2013-12-16 20:35:18
Message-ID: CALRMi60T8YSG0ukTS2CB1imU7PuOWHYg7k1=dQ8EaaHOEOdo=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse psycopg by date

  From Date Subject
Next Message Jesús Espino 2013-12-16 20:38:10 Prepared Statements integration in PsycoPG
Previous Message Karsten Hilbert 2013-12-11 20:35:55 Re: Change License