package links

  1. Overview
  2. Docs
type t =
  1. | Lens of {
    1. table : Database.Table.t;
    2. sort : Sort.t;
    }
  2. | LensSelect of {
    1. lens : t;
    2. predicate : Phrase.t;
    3. sort : Sort.t;
    }
  3. | LensJoin of {
    1. left : t;
    2. right : t;
    3. on : (string * string * string) list;
    4. del_left : Phrase.t;
    5. del_right : Phrase.t;
    6. sort : Sort.t;
    }
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val serialize : t -> string

Serialization using s-expression.

val deserialize : string -> t

Deserialization using s-expression.

val string_of_value : t -> string
val sort : t -> Sort.t
val is_memory_lens : t -> bool
val columns : t -> Column.List.t
val cols_present_aliases : t -> string list

returns the aliases of all present columns.

val colset : t -> Column.Set.t
val fundeps : t -> Fun_dep.Set.t
val predicate : t -> Phrase.t option
val get_primary_key : t -> Alias.Set.t
val generate_query : t -> Database.Select.t
val lens_get : db:Database.t -> t -> Links_lens__.Phrase_value.t list

Fetch the records of a lens from the database.

val lens_select_internal : t -> predicate:Phrase.t -> t

Construct a select lens using the specified underlying lens and select predicate. This should not be used to construct lenses in general, as it may have a bad put direction.

val lens_get_select_opt : db:Database.t -> t -> predicate:Phrase.t option -> Links_lens__.Phrase_value.t list

Generate a select lens from the specified lens and query its results.

val query_exists : db:Database.t -> t -> Phrase.t -> bool
val set_serial : t -> columns:Alias.Set.t -> t

Change the type of the specified columns to be of serial type. Only primitive lenses supported.

OCaml

Innovation. Community. Security.