On Sun, Apr 18, 2004 at 11:04:14AM -0700, Chris Waters wrote:

> I am building a C wrapper for sqlite that can abstract away the sqlite API

Why?  Are you trying to make it easier to port your application to
multiple databases?  If so you should look at the ns_db database API
from AOLserver.  It has had a standard API with drivers for many
different databases for a long, long time now (since 1996 or so).

With AOLserver 4.0, it recently became much more feasible to take the
actual ns_db C code and re-use it outside of AOLserver (e.g., by
loading it into a plain tclsh or the like), but AFAIK no one has
actually done so yet.  (It is on my list of things to do eventually,
but I've had no immediate need.)  However, nstcl already re-implements
ns_db without needing any of the AOLserver C code at all, and already
includes SQLite support.

Note however that nstcl implements the generic ns_db API in the Tcl
layer, so if you need a single consistent API in the underlying C code
rather than just in Tcl, then you'll probably need to look into using
the actual AOLserver C code ns_db implementation.  As a quick hack you
could use nstcl and make calls from C to Tcl, but that would be kind
of ugly, and would probably have noticeably poorer performance than
calling the C implementation directly.  (If you're doing it in an
inner loop, the overhead of going from C to Tcl and back to C can be
quite substantial.)

In addition to the ns_tcl SQLite support, there also seems to be a
native AOLserver SQLite driver (beta, from 2003), but for whatever
reason it's not available in the AOLserver CVS, you have to download
it from its author's own website.

  http://sourceforge.net/projects/aolserver/
  http://sourceforge.net/projects/nstcl/
  http://empoweringminds.mle.ie/openacs/aolserver_modules?orderby=type%2Cmod_name
  http://www.zoro2.org/_chwilowe/nssqlite-beta.tar.gz

> BTW, performance is my primary goal, ease of use is second.

Isn't performance as your my primary goal rather contradictory to
wanting any API abstraction layer at all?  Do you have a real
requirement for a wrapper API (e.g., in order to help support multiple
databases), or is this just an extra Nice to Have feature for you?

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to