Announcing a new version of adodbapi... [ for those who may not know... [ adodbapi is a pure Python package which fully implements the PEP-249 db-api [ using Microsoft ADO/db on Windows. [ It runs on CPython versions 2.3 and later, IronPython 2.6 and later, [ or Python 3.0 and later.
I have often been frustrated by the need to count '?' marks for input parameters and remembering column numbers to get my SQL output. This release fixes that by allowing the use of 'named' parameters as an option, and by returning 'SQLrow' objects which allow the use of column names. This version includes a distutils setup.py file, so installation is easy. It even runs 2to3 automatically if you run it using a 3.n Python. (Why didn't I do this years ago?) Here's what's new............................ * adodbapi version 2.4.0 -- in this version, "fetchall()" and "fetchmany()" return an SQLrows object ...which emulates a sequence of SQLrow objects. "fetchone()" or the cursor's "next()" method return an SQLrow object. An SQLrow object emulates a tuple of data fields. An SQLrow object also appears to have an attribute for each column of data. therefore... >>> import adodbapi >>> myConnection = adodbapi.connection('someDSN') >>> cur = myConnection.cursor() >>> cur.execute("select name, rank, serialNumber from soldiers") >>> row = cur.fetchone() >>> assert row[0] == row['name'] >>> assert row[1] == row.rank >>> rows = cur.fecthall() >>> assert rows[4,'serialNumber'] == rows[4][2] * adodbapi version 2.3.0 -- this is includes major refactoring and specifically adds features for django support, including the ability for the programmer to change ado's SQL "paramstyle" at run time to select between 'qmark', 'format' and 'named' methods of passing SQL parameters. ** also, in response to user requests, adodbapi will now use client-side cursors by default. This will make rowcount and stored procedure return parameter values more readily available.
_______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig