>> 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.
>
> federico

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  <songofaca...@gmail.com>
_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
https://mail.python.org/mailman/listinfo/db-sig

Reply via email to