From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AB0B2BCAE for ; Tue, 19 Jul 2005 13:44:02 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6JBi2wq005179 for ; Tue, 19 Jul 2005 13:44:02 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA13432 for ; Tue, 19 Jul 2005 13:44:01 +0200 (MET DST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6JBhwoR009930 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 19 Jul 2005 13:44:01 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1Duqeo-00084E-00 for ; Tue, 19 Jul 2005 12:53:06 +0100 Date: Tue, 19 Jul 2005 12:53:05 +0100 Cc: Ocaml Subject: Re: [Caml-list] Idea for another type safe PostgreSQL interface Message-ID: <20050719115305.GA29127@furbychan.cocan.org> References: <20050718210518.GA10051@furbychan.cocan.org> <42DC9D16.1080607@barettadeit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42DC9D16.1080607@barettadeit.com> User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at concorde with ID 42DCE782.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42DCE77E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 baretta:01 ocaml:01 compiler:01 abstraction:01 cvs:01 notepad:01 ...:98 maintainable:98 wrote:01 compile:01 define:01 logical:01 dev:01 diff:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Tue, Jul 19, 2005 at 08:26:30AM +0200, Alex Baretta wrote: > I really think XDBS is the the way to go. You define the schema in a > high level language (OO-Entity-Relationship modeling), supporting lower > level refinements (logical, physical and virtual schema refinements) and > compiling to Ocaml and SQL-DDL. This way, the type safety can be > established at compile time without need for a database connection. I think I completely understand this approach, having worked on and with a Java technology called PDL, part of Red Hat's now defunct CMS offering. So I'm interested to know how you solve some of the issues we had with PDL. (1) Changes to the database schema. Does your product allow you to generate the appropriate ALTER TABLE ... statements when the schema changes? How about upgrading an existing live database between versions of the schema? (2) How is the OR mapping handled? PDL had a complex compiler which (supposedly) generated optimal SQL statements from object methods. In practice the developers seemed to spend a lot of time writing hand-optimised queries. I don't really understand what the fuss is about just writing SQL queries directly into code - it's the fastest way I've found to achieve results (if only it were type safe), seems reasonably maintainable, and gets rid of layers of obscure abstraction. In the end I stopped using PDL because the mooted "benefits" - that everything was written in a bunch of obscure files in their case - really didn't have any bearing on real development. I can quite happily tap CREATE TABLE and ALTER TABLE statements directly into a development database, export the schema to CVS to keep track of changes, and use a tool to diff the dev and live schemas for roll-outs and upgrades. > Also, the type safety does not depend on a specific implementation of > SQL, which is usually desireable. I take your point, but really PostgreSQL already does everything I'm ever likely to want to do with a database, it's Free, stable and fast, and actively under development. Rich. PS. Something about PDL here: http://www.redhat.com/docs/manuals/waf/rhea-dg-waf-en-6.0/s1-do-beginning.html -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com