<div dir="ltr">I have often thought that the human race would unite, were we only to be attacked by Martians. To serve that end, I will sacrifice myself and any credibility I might have otherwise retained to present such an attack here.<div>
<br></div><div style>The one thing that the DBAPI group could do to make my wildest DBAPI dreams come true in the next version would be to give me a single method on the cursor object that guaranteed to function uniformly across all databases, albeit at the expense of any "native" performance and reliability advantages in the face of corner cases that I might otherwise have had.</div>
<div style><br></div><div style>In my dream world, I would call this "cur.sexecute".  The "sexecute" method would give me a number of huge advantages in terms of code reuse, because, without tracing through all of the code that might have instantiated the cursor object now in front of me, I would KNOW that this object had a "sexecute" method, and I would know (almost like a contract) that it would behave as follows, consistently across my entire codebase:</div>
<div style><br></div><div style>- 1st param - my SQL - parameterized with "?"</div><div style>- 2nd param - my parameters -- either guaranteed to require a particular form of sequence nesting, or guaranteed to not care.</div>
<div style>- return type - list of tuples</div><div style><br></div><div style>I am not intelligent enough to determine the side effects in such a large user base as you folks have.  For those of you who have developed drivers that are subclassable, there could be users who created their own "sexecute" methods with profoundly different intentions than I have :-)</div>
<div style><br></div><div style>However, I can state the following positives with certainty:</div><div style><br></div><div style>- This would only require ME to change my existing code if I prefer to maximize its re-usability in the face of database uncertainty.</div>
<div style><br></div><div style>- My teammates would remember the method name, even when they are forced to edit in an environment that doesn't support code completion.</div><div style><br></div><div style>- As mentioned, tracing through inheritance and runtime hierarchies to determine if "sexecute" would work would be unnecessary.</div>
<div style><br></div><div style>- You have either implemented this already, or can delegate to another method in your implementation.</div><div style><br></div><div style><div>- Everyone would think you are hip for choosing such an awesome method name.</div>
<div><br></div><div style>Humbly Yours,</div><div style>J. Kennedy</div></div></div>