Improved support for prepared SQL statements
![](https://secure.gravatar.com/avatar/69c4cf2ed8b3ec6b47bf945dfd57617c.jpg?s=120&d=mm&r=g)
Hello, An interface for parameterised SQL statements (working with placeholders) is provided by the execute() method from the Cursor class at the moment. https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute I assume that the "SQL Statement Object" from the SQLite C interface is reused there already. http://sqlite.org/c3ref/stmt.html I imagine that it will be more efficient occasionally to offer also a base class like "prepared_statement" so that the parameter specification does not need to be parsed for every passed command. I suggest to improve corresponding preparation and compilation possibilities. https://bugs.python.org/issue22956 Regards, Markus
![](https://secure.gravatar.com/avatar/0a2191a85455df6d2efdb22c7463c304.jpg?s=120&d=mm&r=g)
On 01.12.2014 13:01, SF Markus Elfring wrote:
Hello,
An interface for parameterised SQL statements (working with placeholders) is provided by the execute() method from the Cursor class at the moment. https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute
I assume that the "SQL Statement Object" from the SQLite C interface is reused there already. http://sqlite.org/c3ref/stmt.html
I imagine that it will be more efficient occasionally to offer also a base class like "prepared_statement" so that the parameter specification does not need to be parsed for every passed command. I suggest to improve corresponding preparation and compilation possibilities. https://bugs.python.org/issue22956
For database questions, please use the DB-SIG: https://mail.python.org/mailman/listinfo/db-sig FWIW: The DB-API which the sqlite3 module implements, supports implicit and explicit reuse of statements: https://www.python.org/dev/peps/pep-0249/ -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Dec 01 2014)
Python Projects, Consulting and Support ... http://www.egenix.com/ mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
2014-11-19: Released mxODBC Connect 2.1.1 ... http://egenix.com/go65 ::::: Try our mxODBC.Connect Python Database Interface for free ! :::::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/
participants (2)
-
M.-A. Lemburg
-
SF Markus Elfring