Module Rel.Type

Column types.

This module defines a type whose values describes the type of columns and how they are represented in OCaml.

Types

type 'a t

The type for column types represented by type 'a in OCaml. These are NOT NULL columns unless option is used.

val bool : bool t

bool is a boolean column type.

val int : int t

int is an int64 column type represented by an OCaml int.

val int64 : int64 t

int64 is an int64 column type.

val float : float t

float is a binary64 IEEE-754 floating point number.

val text : string t

text is an UTF-8 text column type.

val blob : string t

blob is a binary column type.

val option : 'a t -> 'a option t

option c is a nullable column type. Raises Invalid_argument _ if c is already nullable.

Coded types

module Coded : sig ... end

Coded types.

val coded : ('a, 'b) Coded.t -> 'a t

coded c is coded column type defined by c.

Custom types

module Custom : sig ... end

Custom types.

val custom : 'a Custom.t -> 'a t

custom c is a custom column type defined by c.

Predicates

val is_nullable : 'a t -> bool

is_nullable t is true iff t is a column that allows nulls.

Note. Custom types are assumed to be not nullable.

val value_equal : 'a t -> 'a eq

value_equal t is the equality function for the values of t.

Formatting

val pp : Stdlib.Format.formatter -> 'a t -> unit

pp formats column types.

val value_pp : 'a t -> Stdlib.Format.formatter -> 'a -> unit

value_pp t formats values of type t.

Low-level representation

module Repr : sig ... end

Low-level representation (unstable).