[DB-SIG] [ANN] pysqlite 2.0.beta1
gh at ghaering.de
Sun May 8 04:37:34 CEST 2005
I'm glad to announce pysqlite 2.0.beta1. The API is 98 % stable now. And
pysqlite itself should be a lot more stable too, now.
The most notable changes are a lot of fixed refcount bugs, and the added
Download the release here:
win32 binaries for Python 2.3: http://initd.org/pub/software/pysqlite/releases/2.0/2.0.beta1/pysqlite-2.0.beta1.win32-py2.3.exe
win32 binaries for Python 2.4: http://initd.org/pub/software/pysqlite/releases/2.0/2.0.beta1/pysqlite-2.0.beta1.win32-py2.4.exe
pysqlite homepage, bug tracker, wiki: http://pysqlite.org/
Changes since 2.0.alpha4:
- Added pysqlite 2.0 documentation: usage guide and source installation guide.
Adapted from kinterbasdb documentation with the permission of David Rushby.
- Fixed several refcount problems. Per test suite run, lose 0 references
instead of 550 per test suite run like in alpha4.
- If a database file cannot be opened, raise an OperationalError specifically
instead of a DatabaseError.
- Call the row factory with (cursor, row_tuple) instead of (row_tuple).
- Fixed a crash in .connect() when you tried to set a keyword argument. It's
quite annoying that Python doesn't offer a method to extract a single keyword
argument at C-level easily. Argh! So I bit the bullet and duplicated the
parameter extraction code.
- The type name of PrepareProtocol was corrected. Only interesting for
- Added more tests to the test suite.
- Implemented cursor.arraysize.
- cursor.rowcount is now -1 instead of None in case of "not determined", like
the DB-API requires.
- Implemented autocommit mode which replaces the ''no_implicit_begin''
parameter to the module-level connect(). This way, we're more compatible with
other DB-API modules. autocommit parameter in module-level connect and also
an autocommit property of connections. -- The "begin" method of connections
- Completely reworked the advanced type detection:
o connection.register_converter is gone
o instead, the dictionary connection.converters is exposed directly.
o The parameter more_types to the module-level connect is gone.
o Instead, use any combination of PARSE_DECLTYPES and PARSE_COLNAMES for
the new paramter detect_types.
PARSE_DECLTYPES will parse out the first word of a declared type and look
up a converter in connection.converters:
create table foo(col mytype not null)
The decltype would be "mytype not null", but PARSE_DECLTYPES will cut
out "mytype" and look for a converter in converters["mytype"]. If it
finds any, it will use it to convert the value. Otherwise, the standard
SQLite manifest typing will be used.
PARSE_COLNAMES will parse out the column names and look up a converter in
cur.execute("select 1 as "colname [mytype]")
the column names will be parsed for [...], in this case mytype will be
found as the type for the colum, and the converters dictionary will be
consulted for an appropriate converter function. If none is found, the
standard SQLite manifest typing will be used.
Also, the column names in cursor.description will only consist of the first
word. So it would be "colname" in our example, not "colname [mytype]".
- cursor.coltypes is gone.
- The connection attribute of cursors is now made available at Python level.
That's an optional DB-API extension.
- The exception classes are now attributes of the connection objects. That's an
optional DB-API extension.
- Optimized the _sqlite_step_with_busyhandler() function by making time.time()
and time.sleep() available at module import instead of importing the "time"
module each time and getting out the "time" and "sleep" functions each time.
Big performance improvement.
- Some work on the benchmarks.
- Made the destructor of the Cursor class more stable. It used to crash when an
error occured in the Cursor *constructor*.
- Implemented a check that the parameter for Cursor() is actually an instance
of the Connection class (or a subclass thereof).
- Allow long integers as parameters. Re-enable test cases for this.
Gerhard Häring - gh at ghaering.de - Python, web & database development
pysqlite - Powerful and fast embedded database engine "SQLite" for Python.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/db-sig/attachments/20050508/f1379448/attachment.pgp
More information about the DB-SIG