package sequoia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Module Base defines the basic SQL expressions.

type cast +=
  1. | Bool : bool cast
    (*

    cast to bool

    *)
  2. | Int : int cast
    (*

    cast to int

    *)
  3. | Float : float cast
    (*

    cast to float

    *)
  4. | String : string cast
    (*

    cast to string

    *)
  5. | Blob : bytes cast
    (*

    cast to bytes

    *)
type t +=
  1. | Lit : 'a Sequoia_lit.t -> 'a t
  2. | Eq : 'a t * 'a t -> bool t
  3. | Neq : 'a t * 'a t -> bool t
  4. | Gt : 'a t * 'a t -> bool t
  5. | Ge : 'a t * 'a t -> bool t
  6. | Lt : 'a t * 'a t -> bool t
  7. | Le : 'a t * 'a t -> bool t
  8. | And : bool t * bool t -> bool t
  9. | Or : bool t * bool t -> bool t
  10. | Like : string t * string -> bool t
  11. | Not_like : string t * string -> bool t
  12. | In : 'a t * 'a t list -> bool t
  13. | Not_in : 'a t * 'a t list -> bool t
  14. | Is_not_null : 'a option t -> bool t
  15. | Is_null : 'a option t -> bool t
  16. | IAdd : int t * int t -> int t
  17. | ISub : int t * int t -> int t
  18. | IMul : int t * int t -> int t
  19. | IDiv : int t * int t -> int t
  20. | FAdd : float t * float t -> float t
  21. | FSub : float t * float t -> float t
  22. | FMul : float t * float t -> float t
  23. | FDiv : float t * float t -> float t
  24. | LShift : int t * int -> int t
  25. | RShift : int t * int -> int t
  26. | Cast : 'a t * 'b cast -> 'b t

Functions corresponding to SQL operators

val (=) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The = operator.

val (=%) : ('a -> string t) -> string -> 'a -> bool t

The = operator.

The LIKE operator.

val (<>) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The LIKE operator.

The <> operator.

val (<>%) : ('a -> string t) -> string -> 'a -> bool t

The <> operator.

The NOT LIKE operator.

val (>) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The NOT LIKE operator.

The > operator.

val (>=) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The > operator.

The >= operator.

val (<) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The >= operator.

The < operator.

val (<=) : ('a -> 'b t) -> ('a -> 'b t) -> 'a -> bool t

The < operator.

The <= operator.

val (&&) : ('a -> bool t) -> ('a -> bool t) -> 'a -> bool t

The <= operator.

The AND operator.

val (||) : ('a -> bool t) -> ('a -> bool t) -> 'a -> bool t

The AND operator.

The OR operator.

val (+) : ('a -> int t) -> ('a -> int t) -> 'a -> int t

The OR operator.

The + operator for integers.

val (-) : ('a -> int t) -> ('a -> int t) -> 'a -> int t

The + operator for integers.

The - operator for integers.

val (*) : ('a -> int t) -> ('a -> int t) -> 'a -> int t

The - operator for integers.

The * operator for integers.

val (/) : ('a -> int t) -> ('a -> int t) -> 'a -> int t

The * operator for integers.

The / operator for integers.

val (+.) : ('a -> float t) -> ('a -> float t) -> 'a -> float t

The / operator for integers.

The + operator for floats.

val (-.) : ('a -> float t) -> ('a -> float t) -> 'a -> float t

The + operator for floats.

The - operator for floats.

val (*.) : ('a -> float t) -> ('a -> float t) -> 'a -> float t

The - operator for floats.

The * operator for floats.

val (/.) : ('a -> float t) -> ('a -> float t) -> 'a -> float t

The * operator for floats.

The / operator for floats.

val (<<) : ('a -> int t) -> int -> 'a -> int t

The / operator for floats.

The << operator.

val (>>) : ('a -> int t) -> int -> 'a -> int t

The << operator.

The >> operator.

val (=?) : ('a -> 'b t) -> ('a -> 'b t) list -> 'a -> bool t

The >> operator.

The IN operator.

val (<>?) : ('a -> 'b t) -> ('a -> 'b t) list -> 'a -> bool t

The IN operator.

The NOT IN operator.

val is_null : ('a -> 'b option t) -> 'a -> bool t

The IS NULL operator.

val is_not_null : ('a -> 'b option t) -> 'a -> bool t

The IS NULL operator.

The IS NOT NULL operator.

Creation of SQL values

val bool : bool -> 'a -> bool t

A boolean value expression.

val int : int -> 'a -> int t

A boolean value expression.

An int value expression.

val float : float -> 'a -> float t

An int value expression.

A float value expression.

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

A float value expression.

A string value expression.

val blob : bytes -> 'a -> bytes t

A string value expression.

A blob value expression.

Casts

val as_bool : ('a -> 'b t) -> 'a -> bool t

Cast to bool.

val as_int : ('a -> 'b t) -> 'a -> int t

Cast to bool.

Cast to int.

val as_float : ('a -> 'b t) -> 'a -> float t

Cast to int.

Cast to float.

val as_string : ('a -> 'b t) -> 'a -> string t

Cast to float.

Cast to string.

val as_blob : ('a -> 'b t) -> 'a -> bytes t

Cast to string.

Cast to blob.

module Null : sig ... end

Nullable SQL values.