English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2006-01-31 (16:44)
From: Quinn, Chris <chris.quinn@e...>
Subject: RE: [Caml-list] Type-safe interface to Postgres's SQL
A few years ago I implemented a type safe interface to db2 (odbc
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!)