From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id B7ABA7EEBF for ; Sun, 5 Jul 2015 15:45:19 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of flux-caml@inside.org) identity=pra; client-ip=130.230.4.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="flux@modeemi.fi"; x-sender="flux-caml@inside.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of flux@modeemi.fi) identity=mailfrom; client-ip=130.230.4.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="flux@modeemi.fi"; x-sender="flux@modeemi.fi"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.cs.tut.fi) identity=helo; client-ip=130.230.4.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="flux@modeemi.fi"; x-sender="postmaster@mail.cs.tut.fi"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DtAAA/NJlVnCoE5oJcFoNQYKsVBpQgh2UBAQEBAQESAQEBAQEIFAlPhCQBBAF+CwshJQ8BBA0LRIgaAwoIDcEKDYYMhh2FLoJDCh6COIQVBY0EhxGEYoUhgWWBfo87hx2BbwELAYIobIJLAQEB X-IPAS-Result: A0DtAAA/NJlVnCoE5oJcFoNQYKsVBpQgh2UBAQEBAQESAQEBAQEIFAlPhCQBBAF+CwshJQ8BBA0LRIgaAwoIDcEKDYYMhh2FLoJDCh6COIQVBY0EhxGEYoUhgWWBfo87hx2BbwELAYIobIJLAQEB X-IronPort-AV: E=Sophos;i="5.15,410,1432591200"; d="scan'208";a="139018989" Received: from mail.cs.tut.fi ([130.230.4.42]) by mail3-smtp-sop.national.inria.fr with SMTP; 05 Jul 2015 15:45:16 +0200 Received: from amavis2.cs.tut.fi (amavis2.cs.tut.fi [130.230.4.70]) by mail.cs.tut.fi (Postfix) with ESMTP id 31DCC92 for ; Sun, 5 Jul 2015 16:45:15 +0300 (EEST) Received: from mail.cs.tut.fi ([130.230.4.42]) by amavis2.cs.tut.fi (amavis2.cs.tut.fi [130.230.4.70]) (amavisd-maia, port 10024) with ESMTP id 16440-43 for ; Sun, 5 Jul 2015 16:45:14 +0300 (EEST) Received: from modeemi.modeemi.fi (modeemi.modeemi.fi [130.230.72.134]) by mail.cs.tut.fi (Postfix) with SMTP id 6DEB191 for ; Sun, 5 Jul 2015 16:45:14 +0300 (EEST) Received: from coffee.modeemi.fi (coffee.modeemi.fi [130.230.72.140]) by modeemi.modeemi.fi (Postfix) with ESMTP id 54A163A693 for ; Sun, 5 Jul 2015 16:45:14 +0300 (EEST) Received: by coffee.modeemi.fi (Postfix, from userid 17990) id 431B72D611C; Sun, 5 Jul 2015 16:45:14 +0300 (EEST) From: Erkki Seppala To: caml-list@yquem.inria.fr References: Date: Sun, 05 Jul 2015 16:45:14 +0300 In-Reply-To: (Martin DeMello's message of "Sat, 4 Jul 2015 17:03:17 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: Maia Mailguard 1.0.2 Subject: Re: [Caml-list] looking for "real world" sqlite3 examples Hello, Martin DeMello writes: > 2. type conversions - in the absence of an orm, do i have to write my > own by hand per resultset. or is there some intermediate-level library > that i haven't found that would automate some of it? > > 3. is there a maintained library for generating sql queries in a typed manner? You should look into SqlExpr: https://github.com/mfp/ocaml-sqlexpr/ I used it recently for a very small project, and it seemed to work great, even if it doesn't ensure compile-time type safety like PGOCaml. What I would really like would be a database interface that would work with both PostgreSQL and SQLite. Apparently ODBC bindings for OCaml exists, so it would work, but I haven't really tried it out yet.. In particular I would miss SqlExpr :). > But mostly, I want to look at someone else's code and get an idea of > how this is done in ocaml; pretty much all my database code to date > has been written in dynamically typed languages and relied on code > generation. I just write the queries in this small case. It doesn't really allow dynamically composing new queries out from old ones. For that there is macaque: https://github.com/ocsigen/macaque I haven't tried it for a long time, apparently it has matured quite a bit. -- _____________________________________________________________________ / __// /__ ____ __ http://www.modeemi.fi/~flux/\ \ / /_ / // // /\ \/ / \ / /_/ /_/ \___/ /_/\_\@modeemi.fi \/