package sqlgg

  1. Overview
  2. Docs
module Type : sig ... end
module Constraint : sig ... end
module Constraints : sig ... end
type attr = {
  1. name : string;
  2. domain : Type.t;
  3. extra : Constraints.t;
}
val pp_attr : Ppx_deriving_runtime.Format.formatter -> attr -> Ppx_deriving_runtime.unit
val make_attribute : string -> Type.t -> Constraints.t -> attr
module Schema : sig ... end
type table_name = {
  1. db : string option;
  2. tn : string;
}
val pp_table_name : Ppx_deriving_runtime.Format.formatter -> table_name -> Ppx_deriving_runtime.unit
val show_table_name : table_name -> string
val make_table_name : ?db:string -> string -> table_name
type schema = Schema.t
val pp_schema : Ppx_deriving_runtime.Format.formatter -> schema -> Ppx_deriving_runtime.unit
val show_schema : schema -> Ppx_deriving_runtime.string
type table = table_name * schema
val pp_table : Ppx_deriving_runtime.Format.formatter -> table -> Ppx_deriving_runtime.unit
val print_table : 'a IO.output -> (table_name * attr list) -> unit
type param_id = {
  1. label : string option;
  2. pos : int * int;
}

optional name and start/end position in string

val pp_param_id : Ppx_deriving_runtime.Format.formatter -> param_id -> Ppx_deriving_runtime.unit
val show_param_id : param_id -> Ppx_deriving_runtime.string
type param = {
  1. id : param_id;
  2. typ : Type.t;
  3. attr : attr option;
}
val pp_param : Ppx_deriving_runtime.Format.formatter -> param -> Ppx_deriving_runtime.unit
val new_param : ?attr:attr -> param_id -> Type.t -> param
type params = param list
val pp_params : Ppx_deriving_runtime.Format.formatter -> params -> Ppx_deriving_runtime.unit
val show_params : params -> Ppx_deriving_runtime.string
type ctor =
  1. | Simple of param_id * var list option
  2. | Verbatim of string * string
and var =
  1. | Single of param
  2. | Choice of param_id * ctor list
val pp_ctor : Ppx_deriving_runtime.Format.formatter -> ctor -> Ppx_deriving_runtime.unit
val pp_var : Ppx_deriving_runtime.Format.formatter -> var -> Ppx_deriving_runtime.unit
type vars = var list
val pp_vars : Ppx_deriving_runtime.Format.formatter -> vars -> Ppx_deriving_runtime.unit
type alter_pos = [
  1. | `After of string
  2. | `Default
  3. | `First
]
type alter_action = [
  1. | `Add of attr * alter_pos
  2. | `RenameTable of table_name
  3. | `RenameColumn of string * string
  4. | `RenameIndex of string * string
  5. | `Drop of string
  6. | `Change of string * attr * alter_pos
  7. | `None
]
type select_result = schema * param list
type direction = [
  1. | `Fixed
  2. | `Param of param_id
]
val pp_direction : Ppx_deriving_runtime.Format.formatter -> direction -> Ppx_deriving_runtime.unit
val show_direction : direction -> Ppx_deriving_runtime.string
type int_or_param = [
  1. | `Const of int
  2. | `Limit of param
]
type limit_t = [
  1. | `Limit
  2. | `Offset
]
type col_name = {
  1. cname : string;
    (*

    column name

    *)
  2. tname : table_name option;
}
and limit = param list * bool
and nested = source * (source * join_cond) list
and source = [ `Select of select_full | `Table of table_name | `Nested of nested ] * table_name option
and join_cond = [
  1. | `Cross
  2. | `Search of expr
  3. | `Default
  4. | `Natural
  5. | `Using of string list
]
and select = {
  1. columns : column list;
  2. from : nested option;
  3. where : expr option;
  4. group : expr list;
  5. having : expr option;
}
and select_full = {
  1. select : select * select list;
  2. order : order;
  3. limit : limit option;
}
and order = (expr * direction option) list
and 'expr choices = (param_id * 'expr option) list
and expr =
  1. | Value of Type.t
    (*

    literal value

    *)
  2. | Param of param
  3. | Choices of param_id * expr choices
  4. | Fun of Type.func * expr list
    (*

    parameters

    *)
  5. | Select of select_full * [ `AsValue | `Exists ]
  6. | Column of col_name
  7. | Inserted of string
    (*

    inserted value

    *)
and column =
  1. | All
  2. | AllOf of table_name
  3. | Expr of expr * string option
    (*

    name

    *)
val pp_col_name : Ppx_deriving_runtime.Format.formatter -> col_name -> Ppx_deriving_runtime.unit
val show_col_name : col_name -> Ppx_deriving_runtime.string
val pp_limit : Ppx_deriving_runtime.Format.formatter -> limit -> Ppx_deriving_runtime.unit
val pp_nested : Ppx_deriving_runtime.Format.formatter -> nested -> Ppx_deriving_runtime.unit
val show_nested : nested -> Ppx_deriving_runtime.string
val pp_source : Ppx_deriving_runtime.Format.formatter -> source -> Ppx_deriving_runtime.unit
val show_source : source -> Ppx_deriving_runtime.string
val pp_join_cond : Ppx_deriving_runtime.Format.formatter -> join_cond -> Ppx_deriving_runtime.unit
val show_join_cond : join_cond -> Ppx_deriving_runtime.string
val pp_select : Ppx_deriving_runtime.Format.formatter -> select -> Ppx_deriving_runtime.unit
val show_select : select -> Ppx_deriving_runtime.string
val pp_select_full : Ppx_deriving_runtime.Format.formatter -> select_full -> Ppx_deriving_runtime.unit
val show_select_full : select_full -> Ppx_deriving_runtime.string
val pp_order : Ppx_deriving_runtime.Format.formatter -> order -> Ppx_deriving_runtime.unit
val pp_choices : 'expr. (Ppx_deriving_runtime.Format.formatter -> 'expr -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'expr choices -> Ppx_deriving_runtime.unit
val show_choices : 'expr. (Ppx_deriving_runtime.Format.formatter -> 'expr -> Ppx_deriving_runtime.unit) -> 'expr choices -> Ppx_deriving_runtime.string
val pp_expr : Ppx_deriving_runtime.Format.formatter -> expr -> Ppx_deriving_runtime.unit
val pp_column : Ppx_deriving_runtime.Format.formatter -> column -> Ppx_deriving_runtime.unit
val show_column : column -> Ppx_deriving_runtime.string
type columns = column list
val pp_columns : Ppx_deriving_runtime.Format.formatter -> columns -> Ppx_deriving_runtime.unit
val show_columns : columns -> Ppx_deriving_runtime.string
type expr_q = [
  1. | `Value of Type.t
    (*

    literal value

    *)
  2. | `Param of param
  3. | `Choice of param_id * expr_q choices
  4. | `Func of Type.func * expr_q list
    (*

    return type, grouping, parameters

    *)
]
val pp_expr_q : Ppx_deriving_runtime.Format.formatter -> expr_q -> Ppx_deriving_runtime.unit
val show_expr_q : expr_q -> Ppx_deriving_runtime.string
val expr_to_string : expr -> Ppx_deriving_runtime.string
type assignments = (col_name * expr) list
type insert_action = {
  1. target : table_name;
  2. action : [ `Set of assignments option | `Values of string list option * [ `Expr of expr | `Default ] list list option | `Select of string list option * select_full ];
  3. on_duplicate : assignments option;
}
type stmt =
  1. | Create of table_name * [ `Schema of schema | `Select of select_full ]
  2. | Drop of table_name
  3. | Alter of table_name * alter_action list
  4. | Rename of (table_name * table_name) list
  5. | CreateIndex of string * table_name * string list
  6. | Insert of insert_action
  7. | Delete of table_name * expr option
  8. | Set of string * expr
  9. | Update of table_name * assignments * expr option * order * param list
  10. | UpdateMulti of source list * assignments * expr option
  11. | Select of select_full
  12. | CreateRoutine of string * Type.t option * (string * Type.t * expr option) list
module Function : sig ... end
OCaml

Innovation. Community. Security.