caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe TROESTLER <debian00@tiscali.be>
To: pierre.weis@inria.fr
Cc: skaller@ozemail.com.au, rich@annexia.org, caml-list@inria.fr
Subject: Re: [Caml-list] Printf question
Date: Wed, 01 Oct 2003 16:39:55 +0200 (CEST)	[thread overview]
Message-ID: <20031001.163955.29676500.debian00@tiscali.be> (raw)
In-Reply-To: <200309302052.WAA26950@pauillac.inria.fr>

On Tue, 30 Sep 2003, Pierre Weis <pierre.weis@inria.fr> wrote:
> 
> [...] two stages approach [...] eliminate the generation of
> trivially wrong programs (wrong requests).
> 
> Mmm, this is interesting, [...]

Indeed.  So if I got what you say right, one should

1) Develop AST for SQL requests which would guarantee their internal
   coherence (and also write a tool for each DB engine that, for a
   given database, outputs a module (or so) to enable the checking of
   the query against the DB types (1)).

2) Develop Camlp4 macros that translate SQL requests into AST (a la
   "embedded SQL" rather than with strings -- AFAIK embedded SQL is
   normalized).  This would also solve the "binding to variables"
   problem.  One could conform to standard embedded SQL and/or provide
   forms that are more "functional", e.g.

     let FirstName, LastName =
        EXEC SQL SELECT OWNERFIRSTNAME, OWNERLASTNAME
        FROM ANTIQUEOWNERS
        WHERE BUYERID = :BuyerID in ...

   instead of

     EXEC SQL SELECT OWNERFIRSTNAME, OWNERLASTNAME
        INTO :FirstName, :LastName
        FROM ANTIQUEOWNERS
        WHERE BUYERID = :BuyerID in ...

   or

     let v1, v2, v3 = EXEC SQL FETCH ItemCursor in ...

   instead of

     EXEC SQL FETCH ItemCursor INTO :v1, :v2, :v3 in ...

3) Write, for each DB engine, an "evaluator" of the AST.

Once this is done (we need interested people here!!), if the source
compile the requests will be valid SQL queries and statically
typechecked against the DB (given (1)).

Is it possible to evaluate how much effort is needed to get to this
point?  Do people know where to find some (documented) AST for SQL
expressions?  What is the opinion of the existing DB interfaces
writers?

Cheers,
ChriS

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-10-01 14:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-26 18:02 Richard Jones
2003-09-26 19:04 ` Alain.Frisch
2003-09-29  7:44   ` Mike Potanin
2003-09-27  0:11 ` Olivier Andrieu
2003-09-27  7:23   ` Richard Jones
2003-09-27  8:20     ` Basile Starynkevitch
2003-09-27  9:14       ` Richard Jones
2003-09-27  9:39         ` Maxence Guesdon
2003-09-29 16:42         ` Pierre Weis
2003-09-29 18:13           ` Richard Jones
2003-09-29 19:57             ` Pierre Weis
2003-09-29 21:50               ` Richard Jones
2003-09-29 22:36                 ` Pierre Weis
2003-09-30  8:03                   ` Richard Jones
2003-09-30  8:45                     ` Pierre Weis
2003-09-30  9:17                       ` Michal Moskal
2003-09-30 14:14                         ` Christophe TROESTLER
2003-09-30 13:19                   ` skaller
2003-09-30 20:52                     ` Pierre Weis
2003-10-01 14:39                       ` Christophe TROESTLER [this message]
2003-10-01 14:57                         ` Richard Jones
2003-10-01 15:52                           ` [Caml-list] DBI (was: Printf question) Christophe TROESTLER
2003-10-01 16:21                         ` [Caml-list] Printf question Florian Hars
  -- strict thread matches above, loose matches on Subject: below --
2003-05-18  1:34 Brian Hurt
2003-05-18  3:23 ` Manos Renieris
2003-05-18  3:32 ` William Lovas
2003-05-18  6:06 ` Basile STARYNKEVITCH
2003-05-19  9:39   ` Damien

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=20031001.163955.29676500.debian00@tiscali.be \
    --to=debian00@tiscali.be \
    --cc=caml-list@inria.fr \
    --cc=pierre.weis@inria.fr \
    --cc=rich@annexia.org \
    --cc=skaller@ozemail.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).