Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: OCaml <caml-list@inria.fr>
Subject: ANN: OCaml/Sqlite ORM layer (preview 0.2)
Date: Tue, 2 Jun 2009 18:20:23 +0100	[thread overview]
Message-ID: <B526B72B-C545-43AE-9FFB-D2F7A86F63FE@recoil.org> (raw)

I've been using OCaml in a few server projects which need a light- 
weight database, and so I wrote a library to map OCaml objects  
directly to a SQLite3 backend database.

Like other ORM systems, you define a schema based on sets of named  
fields.  The Sql_orm library then generates an OCaml module and  
interface with static accessor methods which take care of all the  
tedious SQL interactions and provide you with a nice high-level,  
statically type-safe access method.

It's still early days but the library is very functional and stable.   
I've put up docs and instructions at:
http://wiki.github.com/avsm/ocaml-orm-sqlite

It's currently written as a module which outputs OCaml directly, and  
once I'm happy with the feature-set, I intend to port it to use camlp4  
so that schemas can be declared directly without the need to  
regenerate a separate ML file.

You can view an example schema at: http://tinyurl.com/sqlorm-example
- schema.ml declares the fields
- test.ml uses it
- my_db.* are the generated files.
- the tests/ directory has more advanced usage, such as foreign keys  
and so on.

-anil


                 reply	other threads:[~2009-06-02 17:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B526B72B-C545-43AE-9FFB-D2F7A86F63FE@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox