-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maurí­cio wrote:
> I'm writing a wrapper for sqlite3 for a different
> language (Haskell). I would like to support different
> versions of sqlite, i.e., user would be able to link
> against a slightly outdated version without having
> link problems due to a recently introduced function.

Are the functions resolved at compile time (static linking) or runtime
(dynamic linking with dlsym/GetProcAddress)?  If at all possible, use
the latter approach.  I can't tell how the Haskell FFI works, but in
Python with ctypes you get a runtime exception on the missing function
and can have an appropriate handler for that.  Also if SQLite is in a
separate DLL then the user can trivially update it.

You also have issues just beyond the version functions were issued in.
It is possible via compiler flags to include more functions (eg
SQLITE_ENABLE_COLUMN_METADATA) or exclude some (eg
SQLITE_OMIT_LOAD_EXTENSION).  Again you'll find your wrapper works best
if it detects which functions are present by runtime linking
(dlsym/GetProcAddress).

  http://www.sqlite.org/compile.html

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmAN/wACgkQmOOfHg372QQ6ZgCgiUAVy7KSBymzeqBw77iwcy7R
x2QAoKdBShTptX66JLwaqrLZm8KWWCR7
=wGkc
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to