Re: Prepared statements [was: Session state per transaction] - Mailing list psycopg

From Karsten Hilbert
Subject Re: Prepared statements [was: Session state per transaction]
Date
Msg-id 20120928103341.GA4253@hermes.hilbert.loc
Whole thread Raw
In response to Prepared statements [was: Session state per transaction]  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: Prepared statements [was: Session state per transaction]
List psycopg
On Fri, Sep 28, 2012 at 02:32:42AM +0100, Daniele Varrazzo wrote:

> I've played a little bit with the idea and made a cursor subclass
> instead: it does everything like a normal cursor, but has a prepare()
> method. If it is called, execute() and executemany() can be called
> without a query, in which case they execute the statement stored (the
> cursor can have only one, but several cursors can be used to prepare
> several statements). If execute*() receive a query too they behave
> like normal cursors

Maybe check the received query string against the already
prepared query string and on match reuse the prepared query ?

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Prepared statements [was: Session state per transaction]
Next
From: Daniele Varrazzo
Date:
Subject: Re: Prepared statements [was: Session state per transaction]