package mysql_protocol

  1. Overview
  2. Docs
type client_error = {
  1. client_error_errno : int;
  2. client_error_sqlstate : string;
  3. client_error_message : string;
}
exception Error of client_error
exception Fetch_no_more_rows
type configuration = {
  1. sockaddr : Unix.sockaddr;
  2. capabilities : Mp_capabilities.capabilities list;
  3. max_packet_size : Int64.t;
  4. charset_number : int;
  5. user : string;
  6. password : string;
  7. databasename : string;
}
type connection = {
  1. configuration : configuration;
  2. mutable channel : (Pervasives.in_channel * Pervasives.out_channel) option;
  3. mutable handshake : Mp_handshake.handshake option;
}
type dml_dcl_result = {
  1. affected_rows : Int64.t;
  2. insert_id : Int64.t;
  3. server_status : int;
  4. warning_count : int;
  5. message : string;
}
type prepare_result = {
  1. prepare_handler : Int64.t;
  2. prepare_nb_columns : int;
  3. prepare_nb_parameters : int;
  4. prepare_warning_count : int;
  5. prepare_parameters_fields : Mp_field_packet.field_packet list;
  6. prepare_parameters_names : Mp_field.field_name list;
  7. prepare_columns_fields : Mp_field_packet.field_packet list;
  8. prepare_columns_names : Mp_field.field_name list;
}
type result = private
  1. | Result_set of Mp_result_set_packet.result_select
  2. | Result_ok of dml_dcl_result
  3. | Result_multiple of result list
type executable_statement = private
  1. | Created_statement of string
  2. | Prepared_statement of string * prepare_result
type execute_result = private
  1. | Executed_statement of string * result
  2. | Executed_prepared_statement of string * prepare_result * result
  3. | Executed_prepared_statement_with_cursor of string * prepare_result
val error_exception_to_string : client_error -> string
val dml_dcl_result_to_string : dml_dcl_result -> string
val configuration : user:string -> password:string -> sockaddr:Unix.sockaddr -> ?databasename:string -> ?max_packet_size:Int64.t -> ?charset:(Mp_charset.charset_name * Mp_charset.collation_name) -> ?capabilities:Mp_capabilities.capabilities list -> unit -> configuration
val connect : configuration:configuration -> ?force:bool -> unit -> connection
val reset_session : connection:connection -> unit
val use_database : connection:connection -> databasename:string -> unit
val ping : connection:connection -> unit
val create_statement_from_string : string -> executable_statement
val prepare : connection:connection -> statement:executable_statement -> executable_statement
val execute : connection:connection -> statement:executable_statement -> ?filter:((string * int) list -> Mp_data.native_data list -> bool) option -> ?iter:((string * int) list -> Mp_data.native_data list -> unit) option -> ?return_all_raw_mysql_data:bool -> ?params:Mp_data.native_data list -> ?bind:Mp_execute.bind -> ?flag:Mp_execute.flag -> unit -> execute_result
val get_result : execute_result -> result
val get_result_multiple : execute_result -> result list
val get_result_ok : execute_result -> dml_dcl_result
val fetch : connection:connection -> statement:execute_result -> ?nb_rows:int64 -> ?filter:((string * int) list -> Mp_data.native_data list -> bool) option -> ?iter:((string * int) list -> Mp_data.native_data list -> unit) option -> ?return_all_raw_mysql_data:bool -> unit -> result
val get_fetch_result_set : result -> Mp_result_set_packet.result_select
val close_statement : connection:connection -> statement:executable_statement -> unit
val disconnect : connection:connection -> unit
OCaml

Innovation. Community. Security.