package mysql_protocol

  1. Overview
  2. Docs

Module Mysql_protocol.Mp_dataSource

Sourcetype sign =
  1. | Positive
  2. | Negative

SQL columns data types.

Sourcetype sql = private
  1. | Null
  2. | Tinyint of int
  3. | Smallint of int
  4. | Int of int
  5. | Longint of Int64.t
  6. | Longlongint of Big_int.big_int
  7. | Decimal of Num.num
  8. | Date of int * int * int
  9. | Time of sign * int * int * int * Int64.t
  10. | Datetime of (int * int * int) * (int * int * int * Int64.t)
  11. | Timestamp of (int * int * int) * (int * int * int * Int64.t)
  12. | Float of float
  13. | Double of float
  14. | Int24 of int
  15. | Year of int
  16. | Varchar of string
  17. | String of string
  18. | Varstring of string
  19. | Blob of Buffer.t
  20. | Binary of Buffer.t
  21. | Varbinary of Buffer.t
  22. | Enum of string
  23. | Set of string
  24. | Bit of Bitstring.t
  25. | Geometry of Bitstring.t
Sourcetype t = sql
Sourceexception Wrong_type of string
Sourceval data_null : t

Build MySQL NULL value

Sourceval data_tinyint : int -> t

Build MySQL TINYINT value

Sourceval data_smallint : int -> t

Build MySQL SMALLINT value

Sourceval data_int : int -> t

Build MySQL INT value

Sourceval data_longint : Int64.t -> t

Build MySQL INT value

Sourceval data_longlongint : Big_int.big_int -> t

Build MySQL BIGINT value

Sourceval data_decimal : Num.num -> t

Build MySQL DECIMAL value

Sourceval data_date : (int * int * int) -> t

Build MySQL DATE (year, month, day) value

Sourceval data_time : (sign * int * int * int * Int64.t) -> t

Build MySQL TIME (sign, hour, min, sec, microsec) value

Sourceval data_datetime : ((int * int * int) * (int * int * int * Int64.t)) -> t

Build MySQL DATETIME ((year, month, day), (hour, min, sec, microsec)) value

Sourceval data_timestamp : ((int * int * int) * (int * int * int * Int64.t)) -> t

Build MySQL TIMESTAMP ((year, month, day), (hour, min, sec, microsec)) value

Sourceval data_float : float -> t

Build MySQL FLOAT value

Sourceval data_double : float -> t

Build MySQL DOUBLE value

Sourceval data_int24 : int -> t

Build MySQL MEDIUM INT value

Sourceval data_year : int -> t

Build MySQL YEAR value

Sourceval data_varchar : string -> t

Build MySQL VARCHAR value

Sourceval data_string : string -> t

Build MySQL CHAR value

Sourceval data_varstring : string -> t

Build MySQL VARCHAR value

Sourceval data_blob : Buffer.t -> t

Build MySQL BLOB value

Sourceval data_binary : Buffer.t -> t

Build MySQL BINARY value

Sourceval data_varbinary : Buffer.t -> t

Build MySQL VARBINARY value

Sourceval data_enum : string -> t

Build MySQL ENUM value

Sourceval data_set : string -> t

Build MySQL SET value

Sourceval data_bit : Bitstring.t -> t

Build MySQL BIT value

Sourceval data_geometry : Bitstring.t -> t

Build MySQL GEOMETRY value

Sourceval to_ocaml_int : t -> int option

Convert column data to OCaml value (int). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of int type.

Sourceval to_ocaml_int64 : t -> Int64.t option

Convert column data to OCaml value (Int64). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of Int64 type.

Sourceval to_ocaml_big_int : t -> Big_int.big_int option

Convert column data to OCaml value (Big_int). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of Big_int type.

Sourceval to_ocaml_num : t -> Num.num option

Convert column data to OCaml value (Num). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of Num type.

Sourceval to_ocaml_date : t -> (int * int * int) option

Convert column data to OCaml value (date). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of date type.

Sourceval to_ocaml_time : t -> (sign * int * int * int * Int64.t) option

Convert column data to OCaml value (time). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of time type.

Sourceval to_ocaml_dt_ts : t -> ((int * int * int) * (int * int * int * Int64.t)) option

Convert column data to OCaml value (datetime/timestamp). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of datetime/timestamp type.

Sourceval to_ocaml_float : t -> float option

Convert column data to OCaml value (float). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of float type.

Sourceval to_ocaml_string : t -> string option

Convert column data to OCaml value (string). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of string type.

Sourceval to_ocaml_buffer : t -> Buffer.t option

Convert column data to OCaml value (Buffer). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of Buffer type.

Sourceval to_ocaml_bitstring : t -> Bitstring.t option

Convert column data to OCaml value (Bitstring). NULL is converted into None.

  • raises Wrong_type

    if the column data is not of Bitstring type.

Sourceval eq : t -> t -> bool

eq v1 v2 tests for structural equality of v1 and v2

Sourceval type_to_string : t -> string

Convert column type to string

Sourceval to_string : t -> string option

Convert column data to string

OCaml

Innovation. Community. Security.