Repodb.Json
repodb · API reference
Backend-specific JSON query helpers.
PostgreSQL, SQLite, and MariaDB/MySQL have overlapping support, but JSON semantics are still backend-specific and should not be treated as portable.
type path_elem = Expr.json_path_elemtype path = Expr.json_pathtype extract_mode = Expr.json_extract_modeval key : string -> Expr.json_path_elemval idx : int -> Expr.json_path_elemval path : string list -> Expr.json_path_elem listval get : ('a, string) Field.t -> Expr.json_path -> string Expr.tval get_text : ('a, string) Field.t -> Expr.json_path -> string Expr.tval eq : string -> 'a Expr.t -> bool Expr.tval neq : string -> 'a Expr.t -> bool Expr.tval is_null : 'a Expr.t -> bool Expr.tval is_not_null : 'a Expr.t -> bool Expr.tval contains : ('a, string) Field.t -> string -> bool Expr.tval contained_by : ('a, string) Field.t -> string -> bool Expr.tval has_key : ('a, string) Field.t -> string -> bool Expr.tval has_path : ('a, string) Field.t -> Expr.json_path -> bool Expr.tval has_any_keys : ('a, string) Field.t -> string list -> bool Expr.tval has_all_keys : ('a, string) Field.t -> string list -> bool Expr.tval array_length : ('a, string) Field.t -> int Expr.tval array_length_at : ('a, string) Field.t -> Expr.json_path -> int Expr.ttype json_type =
| Object
| Array
| String
| Number
| Boolean
| Nullval typeof : ('a, string) Field.t -> string Expr.tval typeof_at : ('a, string) Field.t -> Expr.json_path -> string Expr.t