Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python to Postgres interface with real prepared statements?

I've been trying to find a postgres interface for python 2.x that supports real prepared statements, but can't seem to find anything. I don't want one that just escapes quotes in the params you pass in and then interpolates them into the query before executing it. Anyone have any suggestions?

like image 908
ScottyUCSD Avatar asked Nov 05 '22 19:11

ScottyUCSD


1 Answers

Either py-postgresql for Python3 or pg_proboscis for Python2 will do this.

Python-pgsql will also do this but is not threadsafe. Notably, SQLAlchemy does not make use of prepared statements.

like image 164
Michael Dillon Avatar answered Nov 12 '22 18:11

Michael Dillon