caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Automatically rejected mail
@ 2005-07-19 13:08 Mail Sieve Subsystem
  0 siblings, 0 replies; 2+ messages in thread
From: Mail Sieve Subsystem @ 2005-07-19 13:08 UTC (permalink / raw)
  To: caml-list-admin

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

Your message was automatically rejected by Sieve, a mail
filtering language.

The following reason was given:
Message bounced by server content filter

[-- Attachment #2: Type: message/disposition-notification, Size: 245 bytes --]

[-- Attachment #3: Type: message/rfc822, Size: 6447 bytes --]

From: Richard Jones <rich@annexia.org>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Idea for another type safe PostgreSQL interface
Date: Tue, 19 Jul 2005 12:53:05 +0100
Message-ID: <20050719115305.GA29127@furbychan.cocan.org>

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

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Automatically rejected mail
@ 2005-07-19 13:08 Mail Sieve Subsystem
  0 siblings, 0 replies; 2+ messages in thread
From: Mail Sieve Subsystem @ 2005-07-19 13:08 UTC (permalink / raw)
  To: caml-list-admin

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

Your message was automatically rejected by Sieve, a mail
filtering language.

The following reason was given:
Message bounced by server content filter

[-- Attachment #2: Type: message/disposition-notification, Size: 242 bytes --]

[-- Attachment #3: Type: message/rfc822, Size: 7423 bytes --]

From: jean-claude <caml.4.jean.claude.bourut@neverbox.com>
To: caml-list@inria.fr
Subject: [Caml-list] Re: Idea for another type safe PostgreSQL interface
Date: Tue, 19 Jul 2005 11:55:26 +0000 (UTC)
Message-ID: <loom.20050719T132835-581@post.gmane.org>



Alex Baretta <alex <at> barettadeit.com> writes:
> 
> Richard Jones wrote:
> >   [I just throwing this idea out there to see if people find it
> >   interesting, or want to shoot it down ...  There're only fragments of
> >   working code at the moment]
> > 
> > I'm thinking about a type safe interface to PostgreSQL.  One such
> > interface at the moment is in Xcaml, but it only supports a very small
> > subset of SQL, and I like to use complex SQL.  It seems that there is
> > a way to support the whole of PostgreSQL's language from within OCaml
> > programs, in a type safe way.
> 
> Every once in a while we extend the Embedded SQL with a new feature, but
> we never planned to support all of PostgreSQL. In fact, what we want to
> have is abstraction over the actual DB implementation.
> 
> > The general plan would be to have a camlp4 extension which would use
> > Postgres's new "PREPARE" feature to actually prepare the statements,
> > and Postgres's other new feature, "Describe Statement", to pull out
> > the parameter types and result types from the prepared statement.
> > This allows the camlp4 extension to replace the statement string with
> > a type safe expression, and allow type inference to find mismatches.
> > How a typical program would look is shown at the end of this message.
> 

Back in the pre-internet era, Dec implemented a DBMS (Rdb I think), a C++
compiler and a "compile time" coherency check between C++ and Rdb.

Their implementation had the following features
-1) C++ compilation would read Rdb schema,
-2) There was a strong coupling between database schema and C++ program.
-3) Moving from test environment to production lead us to rebuild the code,
(That’s silly but I could not find a way around it).

We just gave up using it.


> 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.
> Also, the type safety does not depend on a specific implementation of
> SQL, which is usually desireable.
> 
> Alex
> 

Nb: I have never worked with PostgreSQL, BUT, with Oracle, Informix, DB2,
sybase, mssql, the full name of a table ( databasename.login.table ) only binds
to an entry inside a system catalog.

If your application uses several logins, then, checking program structures
against database schema can not really occur before login time.

If the goal is only a sanity check, then using any reference definition can
help, but I don't think it will replase the run time check.

Regards,




_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-19 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-19 13:08 Automatically rejected mail Mail Sieve Subsystem
2005-07-19 13:08 Mail Sieve Subsystem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).