Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sqlite bindings for OCaml

Tags:

sqlite

ocaml

I have been looking for SQLite bindings for OCaml. I stumbled upon ocaml-sqlite3 which looks good and current, but there is no documentation whatsoever about how to use it.

There is some very old documentation (API reference only) of an obsolete ocaml-sqlite binding that was discontinued in 2004. But it really doesn't look current and probably is already quite different from the updated version I found (listed in the above link).

I was just wondering if anybody has some documentation, examples or clue at all of how these libraries work. I could go through the code, but I'd like to keep that option as the last resource.

like image 460
Sergi Mansilla Avatar asked Mar 09 '11 18:03

Sergi Mansilla


2 Answers

Howdy. The ocaml-sqlite3 library you mentioned does, in fact, have documention; you just have to build it with make doc. It's included in the comments in the .mli file as well; you can have a look here: http://hg.ocaml.info/release/ocaml-sqlite3/file/b28bff3ff215/sqlite3.mli . I realize it's basically just an API reference, but it looks fairly comprehensive.

like image 70
phooji Avatar answered Oct 14 '22 01:10

phooji


In addition to phooji's answer, please note that the API follows closely the C sqlite library. Thus, any Sqlite book should help you to use the OCaml binding. And you are correct about which version to use; the one here: http://www.ocaml.info/home/ocaml_sources.html.

like image 23
Ashish Agarwal Avatar answered Oct 14 '22 01:10

Ashish Agarwal