[DB-SIG] Towards a single parameter style
Anthony Tuininga
anthony@computronix.com
Mon, 17 Feb 2003 13:38:52 -0700
On Mon, 2003-02-17 at 13:14, Kevin Jacobs wrote:
> Translation aside, here are a few things I'd rather get from DB-API 3000:
>
> connection = driver.connect(...)
> statement = connection.prepare(sql)
> print statement.description
> cursor = statement.execute(param1, param2, param3)
> cursor.fetchall()
>
> Of course, this syntax _requires_ that the backend support prepared
> statements, instead of trying to piggyback it on to the regular execute
> syntax.
>
> Plus, I wish that DB-API 3000 could decide on an explicit model to support
> connections which can have multiple simultaneous transactions. Some drivers
> fake this by adding .commit() and .rollback() per cursor; others fake this
> by returning multiple connection objects for each phyisical connection.
Can't you do this the same way that you handled statements? In other
words, require a transaction object which has commit() and rollback(),
rather than a connection object which has commit() and rollback(). To
make life easier, an implicit transaction object could be created and
associated with the connection.
> -Kevin
>
> --
> Kevin Jacobs
> The OPAL Group - Enterprise Systems Architect
> Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com
> Fax: (216) 986-0714 WWW: http://www.theopalgroup.com
>
>
> _______________________________________________
> DB-SIG maillist - DB-SIG@python.org
> http://mail.python.org/mailman/listinfo/db-sig
--
Anthony Tuininga <anthony@computronix.com>