[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scsh in PLT Scheme?

Quoth Francisco Solsona on Monday, April 01, 2002:
> What Unix flavor are you using?  I'm using iODBC + {psqlodbc | myodbc}
> together with SrPersist, pretty much out of the box.  This is FreeBSD
> CURRENT (a couple of weeks old), with everything installed via ports.

This was last year.  Probably FreeBSD 4.3 or 4.4.  I have no idea why it
wouldn't work--only that writing my own access library became much more

> I agree raw-ODBC is hideous, though.  Nevertheless, it's been a while
> since I don't use it directly.  The latest version of SchemeQL, which
> you can get from schematics.sourceforge.net, has a clear separation
> between SQL features, and ODBC details.  SchemeQL does not do
> everything you can do through ODBC, though.  Anyway, I'd love to see
> your interface, if it's *simple*, maybe SchemeQL could do the same
> job, and if it's complex enough, maybe SchemeQL could be extended to
> use it as a backend.

Well, the interface is simple in that it's a relatively direct
translation of the underlying C library (libpq).  The point was really
just to get something to work.  There are almost certainly better
approaches.  Although like Oleg's DB interface it does return data
through a callback function--which is definitely not what the C library
does.  At any rate, I would consider my code experimental at best.
Right now if someone needs to connect to Postgres, I'd recommend spgsql.
Had I known that library existed, I would have used it, rather than
write my own.

> Future versions of SchemeQL will support different backends, I already
> have a a copy of `spgsql', for instance, but just haven't had time to
> sit down and write it.  All in all, I think ODBC is widely supported,
> and should not be overlooked.  I kinda like the idea that people, in
> the Windows* world, and other worlds, can use SchemeQL together with
> their favorite DBMS through ODBC painlessly (even though I haven't
> used, nor plan to use Win* for/in a long, long time. ;-)

What I want to put together is a general interface for database
connectivity in Scheme, much like Perl's DBI or Python's DB-API.  If
it's a general enough interface to allow for different database
connection methods, it should be general enough to write an ODBC wrapper
as well.  (There's a DBD::ODBC module for Perl, for example)

As far as integration with SchemeQL, I would prefer to have it use this
interface as a back end.  Like I said in a previous message, I view
SchemeQL as more of an SQL abstraction than a database connectivity
abstraction (although it really is both).  Having them operate on
different levels gives people the option of a nice high-level interface,
without denying them the ability to get into the guts if they need to.

Pat Ekman