[DB-SIG] Re: [Python-Dev] database APIs

Luke Kenneth Casson Leighton lkcl@samba-tng.org
Mon, 3 Feb 2003 21:27:06 +0000


On Mon, Feb 03, 2003 at 04:01:52PM -0500, Kevin Jacobs wrote:

> > p.s. if you're interested in how i managed to get MS-SQL 2000
> >      access from python on a unix system, the code's at
> > 	 http://sf.net/projects/pyxsqmll.
> 
> I use David Cole's MS-SQL w/ Sybase ASE and his Sybase module with FreeTDS. 
> Both provide fast access to MS-SQL 2000 from linux, though neither is 
> quite production quality yet.
 
 the things that pyxsqmll don't do is binary data and HTTPS
 (i have a 15 line patch for the HTTPS) but binary data
 i no longer have access to an MS-SQL database so ain't in a
 position to add it.

 freetds wasn't in a useable state at the time i needed MS-SQL
 access so i plumped for the XML interface option in MS-SQL 2000.

 took only about three days to write that code (based on andy
 dustman's mysqldb cursor stuff) and once written i haven't
 ever needed to do anything drastic to it.

 one thing that _was_ a pain was i used pyxml but on a query
 containing 1,000 records because pyxml used Unicode the HTTP
 response started to take up 40 _megabytes_ of memory and well
 over a minute to process.

 talk about overly complex code, pyxml is a heavy overweight
 hitter.

 i quickly dumped pyxml and went for a SAX interface using
 the python distro's stonkingly simple xmllib to rapidly look
 for specific tag names and nothing else: i couldn't care less
 if MS's code returned bad XML.

 works pretty well now (for about 3 days work and only 8 cvs commits :)

 l.