links

The Links Programming Language
IN THIS PACKAGE
Module Links_lens . Value
type t =
| Lens of {
table : Database.Table.t;
sort : Sort.t;
}
| LensSelect of {
lens : t;
predicate : Phrase.t;
sort : Sort.t;
}
| LensJoin of {
left : t;
right : t;
on : (string * string * string) list;
del_left : Phrase.t;
del_right : Phrase.t;
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.