Popular recipes tagged "prepared_statements"http://code.activestate.com/recipes/tags/prepared_statements/2009-03-23T07:30:07-07:00ActiveState Code RecipesTransparently execute SQL queries as prepared statements with Postgresql (Python)
2009-03-23T07:30:07-07:00Michael Palmerhttp://code.activestate.com/recipes/users/1827292/http://code.activestate.com/recipes/576698-transparently-execute-sql-queries-as-prepared-stat/
<p style="color: grey">
Python
recipe 576698
by <a href="/recipes/users/1827292/">Michael Palmer</a>
(<a href="/recipes/tags/postgresql/">postgresql</a>, <a href="/recipes/tags/prepared_statements/">prepared_statements</a>, <a href="/recipes/tags/sql/">sql</a>).
Revision 4.
</p>
<p>This recipe defines a mixin class for DBAPI cursors that gives them an 'executeps' method. This method transparently converts any SQL query into a prepared statement, which gets cached and executed instead of the original query.</p>