package ez_pgocaml

All checked builds pass
  1. Overview
  2. Docs

Description

Added to opam-repository:

README

Travis-CI Build Status

ez_pgocaml : a simple library to work with pgocaml

Installation

To build:

opam pin .
opam install ez_pgocaml

Usage

A typical usage is to create a database migration tool for your application:

The file updater.ml contains:

let () =
  EzPGUpdater.main Versions.database Versions.versions

where versions.ml contains:

let database = "testdb"

let update_0_to_1 dbh =
  EzPG.exec dbh
      (Printf.sprintf "CREATE TABLE %s (%s)" 
      "users"
         {|
          user_id bigserial PRIMARY KEY,
          login VARCHAR NOT NULL,
          pwhash bytea NOT NULL
         |})

let update_1_to_2 dbh =
    EzPG.exec dbh
      (Printf.sprintf "CREATE TABLE %s (%s)" 
      "infos"
         {|
          user_id bigserial PRIMARY KEY,
          city VARCHAR
         |})

let versions = [
  0, update_0_to_1;
  1, update_1_to_2;
  ]

When ran, the corresponding executable will try to migrate the database from any version to the latest (2 in this example).

Dependencies (3)

  1. pgocaml >= "4.2.2"
  2. dune >= "2.0"
  3. ocaml >= "4.07.0"

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building ez_pgocaml with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
1.0.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure