Re: Prepared statements in python drivers
INADA Naoki <[email protected]> Wed, 9 Apr 2014 19:13:34 +0900
| Newsgroups | gmane.comp.python.db |
|---|---|
| Message-ID | <CAEfz+TwK+9p3ysu5TO3xqsbV58SjATEJMYruQf0XN2PB4O-d=g@mail.gmail.com> |
>> 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 <[email protected]> _______________________________________________ DB-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/db-sig