ogre

Open Generic REpresentation NoSQL Database
IN THIS PACKAGE
Module Ogre . Type
type 'a t

type descriptor.

val int : int64 t

int is represented with OCaml's int64, and has a corresponding representation

val bool : bool t

bool is either true or false.

val str : string t

str represented by a sequence of characters. If the sequence contains whitespaces or parenthesis then the sequence should be delimited with quotes. Note, the requirements are for the database backend implementations. A user of the library shouldn't be bothered by the representation.

val float : float t
val scheme : 'a field -> ( ( 'a -> 'r ) -> 'r, ( 'a -> 'p ) -> 'p ) scheme

scheme field defines a scheme with one field.

val ($) : ( 'a -> 'b -> 'r, 'd -> 'b -> 'p ) scheme -> 'b field -> ( 'a -> 'r, 'd -> 'p ) scheme

scm $field adds a field to a scheme scm.

Usually, all the fields are combined in a one expression, starting with the call to a function scheme, e.g.,

scheme name $ age $ salary

The scheme had type (('a -> 'r) -> 'r, ('a -> 'p) -> 'p) scheme, then the type of a resulting scheme would be [(('a -> 'b -> 'r) -> 'r, ('a -> 'b -> 'p) -> 'p) scheme], i.e., a type of $field will be attached to the scheme.

For example, the scheme name $age $salary expression will have a type (assuming, that name, age and salary are represented with string, int, and int, correspondingly):

(string -> int64 -> int64 -> 'a) -> 'a,
(string -> int64 -> int64 -> 'b) -> 'b

The scheme is used to construct an attribute. See below.

val def : string -> 'a t -> 'a field

def name t defines a field with the give name and type t.

val (%:) : string -> 'a t -> 'a field

name : t is the same as def name t