Sybase module 0.30 (Graham Ashton release) released

Dave Cole djc@object-craft.com.au
18 Jul 2001 13:09:33 +1000


What is it:

The Sybase module provides a Python interface to the Sybase relational
database system. It supports all of the Python Database API, version
2.0 with extensions.  This is the first release in which the DB-API
compliance is as close as it can get with Sybase.

There was a recent thread on comp.lang.python where Python database
modules were labelled experimental and unsupported.  We have decided
to label ours as non-experimental and will be offering commercial
support from this release.  Please refer to our website for details:

	http://www.object-craft.com.au/support.html

For those people who do not have LaTeX installed, there is a PDF
version of the package documentation.  The PostScript version prints
out a handy A5 booklet on an A4 duplex printer.

The module and documentation are all available on here:

	http://www.object-craft.com.au/projects/sybase/

Thanks
------

Many thanks to Graham Ashton for spending time working with me to
isolate the dynamic SQL deallocation bug.


Changes for this release
------------------------

Bugfixes:

1) Dynamic SQL constructed for cursor is now deallocated.  After
   around 9000 different queries over the same cursor the server was
   running out of procedure space.

2) ct_con_props() CS_TDS_VERSION is an integer no a string.

3) ct_con_props(), ct_options(), ct_config() were returning string
   values with trailing nul character.

4) ct_config() CS_VERSION is an integer no a string.

5) Fixed refcount leak in ct_res_info(CS_ORDERBY_COLS)


DB-API compliance:

1) Implemented DB-API STRING, BINARY, NUMBER, DATETIME, and ROWID type
   objects.

2) Implemented DB-API Date(), Timestamp(), DateFromTicks(),
   TimestampFromTicks(), and Binary() functions.


Documentation:

1) Complete DB-API documentation for Sybase.py

2) Low level sybasect extension module now explains how the Sybase API
   is wrapped - it does not attempt to explain how to use the API.
   Sybase have excellent documentation which covers that.

   Documentation for bulkcopy descriptors includes a small program to
   bulkcopy a table from one server to another using a single set of
   buffers.

3) Miscellaneous docstring fixups.

Improvements and enhancements:

1) All binary dependence on mxDateTime has been removed - it is now
   integrated at Python level.

   If mxDateTime is available then datetime columns will be returned
   as mxDateTime.DateTime objects - otherwise they are returned as
   internal DateTime objects.

   You can disable the use of mxDateTime by doing this:

	import Sybase
	Sybase.use_datetime = 0

2) Renamed con object in Sybase.py to conn to be consistent with
   sybasect wrapper module.

3) Reorganised and simplified cursor DB-API state machine in Sybase.py.

4) Wrap all Sybase API functions with checks for exceptions raised by
   Python callback functions.

5) Added debug, conn, and direction attributes to CS_BLKDESC object.

6) When CS_DATAFMT structures are cleared when initialised - eliminates
   possibility of unexpected values.

7) Added native Sybase datetime/smalldatetime object.  Construct and
   use these objects like this:

>>> import Sybase
>>> a = Sybase.money(25.99)
>>> type(a)
<type 'MoneyType'>
>>> b = a + 5
>>> b
30.99
>>> type(b)
<type 'MoneyType'>
>>> b - a
5.00
>>> dt = Sybase.datetime('2001-07-17', Sybase.CS_DATETIME4_TYPE)
>>> dt
Jul 17 2001 12:00AM
>>> type(dt)
<type 'DateTimeType'>

8) Added native Sybase money/smallmoney object.

9) DataBuf objects can autoconvert values to money and numeric values
   during assignment.

-- 
http://www.object-craft.com.au