[Pythonmac-SIG] Silly question? Database server (Mac OS 9 / Mac OS x / PC-Win)

Richard Gordon richard@richardgordon.net
Fri, 7 Dec 2001 12:16:19 -0500


At 11:00 AM -0500 12/7/01, Schollnick, Benjamin wrote:
>MySQL doesn't seem to have a Mac version, that I could find?

Not unless something has been made available for OS X.

>Does anyone know of a Macintosh database that is Python accessible,
>preferably
>with a SQL style interface?  (i.e. I pass a SQL statement to the database
>engine)
>
>If necessary, I'll make a translation layer, for the PC version... But I
>really
>haven't looked into any of Mac Database packages (except Filemaker Pro
>v4)...
>Preferably this should be free, since however runs this would need it...

I think that the only thing that meets all of your criteria is Gadfly 
SQL which is pure python and available for free at 
http://www.chordate.com/gadfly.html. It's interesting to play with, 
but I personally ran into a problem regarding query results exceeding 
some internal limits even tho they were not especially large and 
Gadfly is in any case not intended to be used in heavy production 
environments.

The biggest problem is that as far as I know, it hasn't been updated 
in quite a while. You will have to convert the line endings of its 
components to get it to run on a Mac and then edit a couple of files 
to make it work with Python 2.x regardless of platform:

gfserve.py line 335:
#change from
#sock.bind(self.HOST, self.port)
#to
tupleName = self.HOST, self.port
sock.bind(tupleName)

gfclient.py line 141:
#change from
#sock.connect(self.machine, self.port)
#to
tupleName = self.machine, self.port
sock.connect(tupleName)

Depending on what you need to do, you might also consider the shelve 
module if you really just need a persistent dictionary-like object. 
It's very simple to use and has been quite fast when I've used it in 
cgi hit counters and stuff like that.


Richard Gordon
--------------------
Gordon Design
Web Design/Database Development
http://www.richardgordon.net