This directory contains some examples.

To run them, you'll need a PostgreSQL >= 7.3 database server
accessible, and a database which you can access.  We only write
temporary tables, so none of these examples should actually modify the
database.  If your database is located remotely, be sure to set the
$PGHOST environment variable to point to the database server.

You will also need Alaine Frische's original Postgres driver:
http://www.eleves.ens.fr/home/frisch/soft.html#postgres

You may also use Markus Mottl's modified Postgresql driver:
http://www.oefai.at/~markus/home/ocaml_sources.html#postgresql-ocaml
but you will need to modify the Makefile and code to change references
from postgres -> postgresql.

These examples may or may not work against MySQL.  (Not tested).

It's more fun to actually study the source code anyway.

The order in which you should look at the examples is:

  make-connection.ml

  simple-select.ml
  simple-select-one-row.ml
  simple-update.ml
  simple-insert.ml

  date-and-time.ml
  booleans.ml
  optional.ml

  column-names.ml
