Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] PostgreSQL-OCaml 1.0.1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Shawn Wagner <shawnw@s...>
Subject: Re: [Caml-list] PostgreSQL-OCaml 1.0.1
On Fri, Jan 30, 2004 at 12:50:41AM -0500, Josh Burdick wrote:

>   If there's going to be a "new improved version", I think maybe it 
> should work with multiple databases.  ODBC, JDBC, and DBI all attempt 
> this.  There could be a signature (perhaps called "DBI" to appeal to 
> Perl people , and structs Postgres, MySQL, Oracle, etc., which implement 
> this.

I think there are a couple of projects to do this. I maintain the MySQL
bindings for ocaml, and I'm willing to support any such database-independant
interface to SQL in it.

>   Different databases have varying levels of standards-conformance, of 
> course, and there's all sorts of variation between databases, so I 
> wouldn't expect one to be able to take one OCaml program written with 
> this interface, and blithely switch databases, especially for 
> complicated stuff.  But you should be able to write simple "select * 
> from customers"-type queries, against any database, without totally 
> re-working your OCaml code.

I've had vague ideas of adding functions that build the query strings for
you, so you can do things like

let querystring = Sql.select ~table:"addresses"
~columns:["street";"city";"state";"zipcode"] ~where:"name='so and so'"
and then feed that to whatever database library you like: MySQL, Postgres,
Oracle, whatever.

If I actually used SQL these days, I'd probably have done it already. Anyone
interested in this sort of thing?

-- 
Shawn Wagner
shawnw@speakeasy.org

-------------------
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