Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Type-safe interface to Postgres's SQL
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff <brogoff@s...>
Subject: RE: [Caml-list] Type-safe interface to Postgres's SQL
On Tue, 31 Jan 2006, Quinn, Chris wrote:
> A few years ago I implemented a type safe interface to db2 (odbc
> compliant).
> My approach was to extend the caml compiler with a Type.typeof : 'a ->
> typeinfo function
> which marshalled the internal type info into a string.
> This is then used at runtime to compare with the database's notion of
> what a query produces
> (the check is performed only once during the execution life of the
> program, thereby minimising cost)
> So any mismatch with the db schema is caught (as long as that bit of the
> code is actually run!)

Sounds like GCaml (http://www.y1.is.s.u-tokyo.ac.jp/~furuse/gcaml) would have
allowed you to express this directly. The better typed marshalling has been
on my wishlist for a while

-- Brian