[DB-SIG] Prepared statements in python drivers
songofacandy at gmail.com
Wed Apr 9 12:13:34 CEST 2014
>> I think prepared statement should be bound to connection.
>> Connection.prapare(name, stmt, skip_on_dup=False)
>> Prepare stmt as name.
>> If skip_on_dup is true and same name is prepared before, do nothing.
>> Cursor.execute_prepared(name, params, stmt=None)
>> Execute prepared statement named name.
>> If stmt is not None, call Cursor.prepare(name, stmt, skip_on_dup=True)
>> before execute.
> This seems to complicate the code for no gain. The API previously
> proposed is much better IMO.
Previously proposed API may prepare multiple times.
My propose make it easier to reuse same prepared statement over function call.
Imagine about simple, high performance simple API server.
One API call may execute one statement, but it called so often.
INADA Naoki <songofacandy at gmail.com>
More information about the DB-SIG