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 make_attribute : string -> Type.t -> Constraints.t -> attr
module Schema : sig ... end
type table_name = {
  1. db : string option;
  2. tn : string;
}
val show_table_name : table_name -> string
val make_table_name : ?db:string -> string -> table_name
type schema = Schema.t
val show_schema : schema -> Ppx_deriving_runtime.string
type table = table_name * schema
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 show_param_id : param_id -> Ppx_deriving_runtime.string
type param = {
  1. id : param_id;
  2. typ : Type.t;
  3. attr : attr option;
}
val new_param : ?attr:attr -> param_id -> Type.t -> param
type params = param list
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. | SingleIn of param
  3. | ChoiceIn of {
    1. param : param_id;
    2. kind : [ `In | `NotIn ];
    3. vars : var list;
    }
  4. | Choice of param_id * ctor list
  5. | TupleList of param_id * schema
type vars = var list
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 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. | Inparam of param
  4. | Choices of param_id * expr choices
  5. | InChoice of param_id * [ `In | `NotIn ] * expr
  6. | Fun of Type.func * expr list
    (*

    parameters

    *)
  7. | SelectExpr of select_full * [ `AsValue | `Exists ]
  8. | Column of col_name
  9. | Inserted of string
    (*

    inserted value

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

    name

    *)
val show_col_name : col_name -> Ppx_deriving_runtime.string
val show_nested : nested -> Ppx_deriving_runtime.string
val show_source : source -> Ppx_deriving_runtime.string
val show_join_cond : join_cond -> Ppx_deriving_runtime.string
val show_select : select -> Ppx_deriving_runtime.string
val show_select_full : select_full -> Ppx_deriving_runtime.string
val show_column : column -> Ppx_deriving_runtime.string
type columns = column list
val show_columns : columns -> 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 | `Param of string list option * param_id | `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. | DeleteMulti of table_name list * nested * expr option
  9. | Set of string * expr
  10. | Update of table_name * assignments * expr option * order * param list
  11. | UpdateMulti of source list * assignments * expr option
  12. | Select of select_full
  13. | CreateRoutine of string * Type.t option * (string * Type.t * expr option) list
module Function : sig ... end
OCaml

Innovation. Community. Security.