[gambit-list] Re: SQLite 2.4.7

hafner at sdf-eu.org hafner at sdf-eu.org
Thu Jan 20 05:44:29 EST 2005


Marc Feeley <feeley at IRO.UMontreal.CA> wrote/schrieb <200501200142.j0K1gL4f008223 at baro.iro.umontreal.ca>:

> Sounds interesting.  Why did you choose SQLite rather than mysql?

I intend to use the DB on SDF-EU <http://www.sdf-eu.org/>, where I
have a shell account as a supporting member (so called ``MetaARPA'').
There is also a MySQL DB, but I had to pay more to use it. I can
compile my own stuff there as far as I don't run of quota, but I'm not
allowed to run server processes. So I guessed, that SQLite fits better
to my needs than MySQL.

Another reason is, that SQLite lets me link with my stuff to a
standalone program, that I can deliver to somebody else without
forcing him to install/configure dependent stuff (``embedded DB'').

> Here are some comments on your code.
> 
> Callbacks are fine in a single threaded program.  However, because of
> the way continuations are handled (and Gambit uses continuations to
> implement preemptive threads) it will not be possible to reliably have
> more than one thread interacting with the database.
> [...  detailed explanation ...]
> A better approach is to use the sqlite_compile, sqlite_step,
> and sqlite_finalize API which does not use callbacks.

The API you're describing is not provided by SQLite version 2.4.7, but
I remember I've seen it already somewhere. I guess it's part of a more
recent version of SQLite.

Does somebody know an already existing Gambit adapter for that newer
SQLite API?

The reasons why I'm still using the old version of SQLite are:
- SDF-EU runs NetBSD 1.6.2, and last time I've checked the NetBSD
  source package tree, I havn't seen a newer version of SQLite there.
- At home I've Debian 3.0, also missing a newer SQLite version -- of
  course: typically Debian stable :-)

It seems to me, that I can do one of the following alternatives:
- Pay for MySQL access.
- Keep all like it is, but let only one thread per program use the DB.
- Try to build the newer SQLite version on NetBSD 1.6.2 and Debian 3.0
  and write a Gambit adapter using the interfaces that you've
  proposed.

Thanks for the hints.

Regards
  Thomas Hafner



More information about the Gambit-list mailing list