can you please give me a hint what is the preferable way to access a mysql database with plt?
Doing a search on the web, I found
- the sqlid.plt package on Planet, by Hans Oesterholt , but it does not include a mysql driver, at least not in the current version, so I suppose I cannot use it?
- the mysqlclient.ss from riverbot, which I don't know will work with PLT 4?
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.
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 3.99.0.2, 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).
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.
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.
> 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 3.99.0.2, 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).
< Every time I update DrScheme from SVN, I rebuild and mysqlclient. -- > Every time I update DrScheme from SVN, I rebuild and test mysqlclient. _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme
On Mon, 22 Dec 2008 21:00:19 -0500 "Geoffrey S. Knauth" <ge...@knauth.org> wrote:
> 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.
That's a good idea. Although I suppose RoR uses a rather high-level interface. The Python DB API <http://www.python.org/dev/peps/pep-0249/> provides a rather low-level interface that every SQL library worth speaking of supports (you might want to skim through it for an API that works with many libraries and is low-level enough not to tie into specific functionality). Seeing something like this for DrScheme would be great.
> The Python DB API <http://www.python.org/dev/peps/pep-0249/> > provides a rather low-level interface that every SQL library worth > speaking of supports (you might want to skim through it for an API > that works with many libraries and is low-level enough not to tie > into specific functionality).
Thanks a lot for the information! Especially many thanks, Geoffrey, for the link to the files - this will be very useful to me, the adapted mysqlclient and also the usage examples!
stelvio wrote: > Thanks a lot for the information! > Especially many thanks, Geoffrey, for the link to the files - this > will be very useful to me, the adapted mysqlclient and also the usage > examples!
FWIW - if it doesn't have to be MySQL, then try the bindings for SQLite. They are uptodate.
> stelvio wrote: > > Thanks a lot for the information! > > Especially many thanks, Geoffrey, for the link to the files - this > > will be very useful to me, the adapted mysqlclient and also the usage > > examples!
> FWIW - if it doesn't have to be MySQL, then try the bindings > for SQLite. They are uptodate.