From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 92552BBAF for ; Tue, 2 Jun 2009 19:20:31 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUEAKL8JErCRgOEgWdsb2JhbACYEQEBFiK3VIQLBQ X-IronPort-AV: E=Sophos;i="4.41,292,1241388000"; d="scan'208";a="27212739" Received: from fork.recoil.org ([194.70.3.132]) by mail2-smtp-roc.national.inria.fr with SMTP; 02 Jun 2009 19:20:31 +0200 Received: (qmail 31664 invoked by uid 3023); 2 Jun 2009 17:20:25 -0000 Received: from [217.41.228.237] (HELO [10.165.242.96]) (217.41.228.237) (smtp-auth username remote@recoil.org, mechanism cram-md5) by fork.recoil.org (qpsmtpd/0.32) with ESMTP; Tue, 02 Jun 2009 18:20:24 +0100 Message-Id: From: Anil Madhavapeddy To: OCaml Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: ANN: OCaml/Sqlite ORM layer (preview 0.2) Date: Tue, 2 Jun 2009 18:20:23 +0100 X-Mailer: Apple Mail (2.935.3) X-Spam: no; 0.00; anil:01 anil:01 ocaml:01 ocaml:01 accessor:01 high-level:01 statically:01 type-safe:01 wiki:01 camlp:01 wrote:01 define:02 functional:02 objects:02 module:03 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