[plt-scheme] query mysql from scheme

From: Geoffrey S. Knauth (geoff at knauth.org)
Date: Mon Dec 22 21:00:19 EST 2008


Indeed I am still using David Van Horn's mysqlclient.  Every time I  
update DrScheme from SVN, I rebuild and mysqlclient.  I had to make  
very minor adjustments a few years ago, and another minor adjustment  
during the v300 to v4.x transition.  It works.  I routinely alternate  
between Mac OS X and Ubuntu.

I just put everything I use here:


You'll see two directories, mysqlclient and teaching-db.  mysqlclient  
is basically David's code with really minor modifications done to keep  
it working five years after he wrote it.  teaching-db is a hack of  
mine:  I keep grades and assignments in a MySQL database, because it  
helps me remember who submitted what, whose stuff needs to be graded,  
how people are doing, etc.  I just put it there so you could see a  
little bit of code that uses DVH's code, then you can adapt it for  
your own use.

At some point I'd love to repackage mysqlclient, put it into PLaneT,  
etc., but first I want to look at the other database packages on  
PLaneT and see if there's a way to unify the approaches.  For example,  
in Ruby on Rails, it's easy to switch database engines with minimal  
changes to config files.  It would be grand if database work using  
DrScheme were so easily retargeted.


On Dec 22, 2008, at 18:49, David Van Horn wrote:

> Sigrid Keydana wrote:
>> - the mysqlclient.ss from riverbot, which I don't know will work with
>> PLT 4?
> Geoffrey Knauth was using the library a year ago with, so  
> it may be possible (Geoff may also have improvements to the code,  
> which I haven't touched in 5 years).  You'll likely need to tweak  
> the mysqlclient code for v4 and whatever version of MySQL you're  
> using.
>> My requirements regarding sql queries are very humble, just simple
>> selects and updates, and I'd like to use PLT 4, not 3, to get used to
>> the changes (which don't seem too trivial if you're still a scheme
>> beginner...)
>> I'd be grateful for a hint which might be the easiest/stablest/most
>> "out-of-the-box" way to use mysql in scheme, as this is only a  
>> marginal
>> (but inevitable) part of the application.
> You could try using the Foreign interface to make calls to the mysql  
> library.  (It wasn't around when I wrote mysqlclient.ss).

Posted on the users mailing list.