Mysql

`sig
type dbd
type db = {
dbhost : string option;
dbname : string option;
dbport : int option;
dbpwd : string option;
dbuser : string option;
dbsocket : string option;
}
val defaults : Mysql.db
type protocol =
PROTOCOL_DEFAULT
| PROTOCOL_TCP
| PROTOCOL_SOCKET
| PROTOCOL_PIPE
| PROTOCOL_MEMORY
type db_option =
OPT_COMPRESS
| OPT_NAMED_PIPE
| OPT_LOCAL_INFILE of bool
| OPT_RECONNECT of bool
| OPT_SSL_VERIFY_SERVER_CERT of bool
| REPORT_DATA_TRUNCATION of bool
| SECURE_AUTH of bool
| OPT_PROTOCOL of Mysql.protocol
| OPT_CONNECT_TIMEOUT of int
| OPT_READ_TIMEOUT of int
| OPT_WRITE_TIMEOUT of int
| INIT_COMMAND of string
| READ_DEFAULT_FILE of string
| READ_DEFAULT_GROUP of string
| SET_CHARSET_DIR of string
| SET_CHARSET_NAME of string
| SHARED_MEMORY_BASE_NAME of string
| OPT_FOUND_ROWS
val init : unit -> unit
val connect : ?options:Mysql.db_option list -> Mysql.db -> Mysql.dbd
val quick_connect :
?options:Mysql.db_option list ->
?host:string ->
?database:string ->
?port:int ->
?password:string -> ?user:string -> ?socket:string -> unit -> Mysql.dbd
val set_charset : Mysql.dbd -> string -> unit
val change_user : Mysql.dbd -> Mysql.db -> unit
val quick_change :
?user:string -> ?password:string -> ?database:string -> Mysql.dbd -> unit
val select_db : Mysql.dbd -> string -> unit
val disconnect : Mysql.dbd -> unit
val ping : Mysql.dbd -> unit
val list_dbs : Mysql.dbd -> ?pat:string -> unit -> string array option
val client_info : unit -> string
val host_info : Mysql.dbd -> string
val server_info : Mysql.dbd -> string
val proto_info : Mysql.dbd -> int
exception Error of string
type error_code =
Aborting_connection
| Access_denied_error
| Alter_info
| Bad_db_error
| Bad_field_error
| Bad_host_error
| Bad_null_error
| Bad_table_error
| Blob_cant_have_default
| Blob_key_without_length
| Blob_used_as_key
| Blobs_and_no_terminated
| Cant_create_db
| Cant_create_file
| Cant_create_table
| Cant_create_thread
| Cant_delete_file
| Cant_drop_field_or_key
| Cant_find_dl_entry
| Cant_find_system_rec
| Cant_find_udf
| Cant_get_stat
| Cant_get_wd
| Cant_initialize_udf
| Cant_lock
| Cant_open_file
| Cant_open_library
| Cant_read_charset
| Cant_read_dir
| Cant_remove_all_fields
| Cant_reopen_table
| Cant_set_wd
| Checkread
| Columnaccess_denied_error
| Commands_out_of_sync
| Con_count_error
| Conn_host_error
| Connection_error
| Db_create_exists
| Db_drop_delete
| Db_drop_exists
| Db_drop_rmdir
| Dbaccess_denied_error
| Delayed_cant_change_lock
| Delayed_insert_table_locked
| Disk_full
| Dup_entry
| Dup_fieldname
| Dup_key
| Dup_keyname
| Dup_unique
| Empty_query
| Error_on_close
| Error_on_read
| Error_on_rename
| Error_on_write
| Field_specified_twice
| File_exists_error
| File_not_found
| File_used
| Filsort_abort
| Forcing_close
| Form_not_found
| Function_not_defined
| Get_errno
| Got_signal
| Grant_wrong_host_or_user
| Handshake_error
| Hashchk
| Host_is_blocked
| Host_not_privileged
| Illegal_grant_for_table
| Illegal_ha
| Insert_info
| Insert_table_used
| Invalid_default
| Invalid_group_func_use
| Invalid_use_of_null
| Ipsock_error
| Key_column_does_not_exits
| Key_not_found
| Kill_denied_error
| Load_info
| Localhost_connection
| Mix_of_group_func_and_fields
| Multiple_pri_key
| Namedpipe_connection
| Namedpipeopen_error
| Namedpipesetstate_error
| Namedpipewait_error
| Net_error_on_write
| Net_fcntl_error
| Net_packet_too_large
| Net_packets_out_of_order
| Net_read_error
| Net_read_error_from_pipe
| Net_read_interrupted
| Net_uncompress_error
| Net_write_interrupted
| Nisamchk
| No
| No_db_error
| No_raid_compiled
| No_such_index
| No_such_table
| No_such_thread
| No_tables_used
| No_unique_logfile
| Non_uniq_error
| Nonexisting_grant
| Nonexisting_table_grant
| Nonuniq_table
| Normal_shutdown
| Not_allowed_command
| Not_form_file
| Not_keyfile
| Null_column_in_index
| Old_keyfile
| Open_as_readonly
| Out_of_memory
| Out_of_resources
| Out_of_sortmemory
| Outofmemory
| Parse_error
| Password_anonymous_user
| Password_no_match
| Password_not_allowed
| Primary_cant_have_null
| Ready
| Record_file_full
| Regexp_error
| Requires_primary_key
| Server_gone_error
| Server_handshake_err
| Server_lost
| Server_shutdown
| Shutdown_complete
| Socket_create_error
| Stack_overrun
| Syntax_error
| Table_cant_handle_auto_increment
| Table_cant_handle_blob
| Table_exists_error
| Table_must_have_columns
| Table_not_locked
| Table_not_locked_for_write
| Tableaccess_denied_error
| Tcp_connection
| Textfile_not_readable
| Too_big_fieldlength
| Too_big_rowsize
| Too_big_select
| Too_big_set
| Too_long_ident
| Too_long_key
| Too_long_string
| Too_many_delayed_threads
| Too_many_fields
| Too_many_key_parts
| Too_many_keys
| Too_many_rows
| Too_many_tables
| Udf_exists
| Udf_no_paths
| Unexpected_eof
| Unknown_character_set
| Unknown_com_error
| Unknown_error
| Unknown_host
| Unknown_procedure
| Unknown_table
| Unsupported_extension
| Update_info
| Update_without_key_in_safe_mode
| Version_error
| Wrong_auto_key
| Wrong_column_name
| Wrong_db_name
| Wrong_field_spec
| Wrong_field_terminators
| Wrong_field_with_group
| Wrong_group_field
| Wrong_host_info
| Wrong_key_column
| Wrong_mrg_table
| Wrong_outer_join
| Wrong_paramcount_to_procedure
| Wrong_parameters_to_procedure
| Wrong_sub_key
| Wrong_sum_select
| Wrong_table_name
| Wrong_value_count
| Wrong_value_count_on_row
| Yes
type status = StatusOK | StatusEmpty | StatusError of Mysql.error_code
val status : Mysql.dbd -> Mysql.status
val errno : Mysql.dbd -> Mysql.error_code
val errmsg : Mysql.dbd -> string option
type result
val exec : Mysql.dbd -> string -> Mysql.result
val fetch : Mysql.result -> string option array option
val to_row : Mysql.result -> int64 -> unit
val size : Mysql.result -> int64
val iter : Mysql.result -> f:(string option array -> unit) -> unit
val iter_col :
Mysql.result -> key:string -> f:(string option -> unit) -> unit
val iter_cols :
Mysql.result ->
key:string array -> f:(string option array -> unit) -> unit
val map : Mysql.result -> f:(string option array -> 'a) -> 'a list
val map_col :
Mysql.result -> key:string -> f:(string option -> 'a) -> 'a list
val map_cols :
Mysql.result ->
key:string array -> f:(string option array -> 'a) -> 'a list
val column :
Mysql.result -> key:string -> row:string option array -> string option
type dbty =
IntTy
| FloatTy
| StringTy
| SetTy
| EnumTy
| DateTimeTy
| DateTy
| TimeTy
| YearTy
| TimeStampTy
| UnknownTy
| Int64Ty
| BlobTy
| DecimalTy
type field = {
name : string;
table : string option;
def : string option;
ty : Mysql.dbty;
max_length : int;
flags : int;
decimals : int;
}
val pretty_type : Mysql.dbty -> string
val affected : Mysql.dbd -> int64
val insert_id : Mysql.dbd -> int64
val fields : Mysql.result -> int
val names : Mysql.result -> string array
val types : Mysql.result -> Mysql.dbty array
val fetch_field : Mysql.result -> Mysql.field option
val fetch_fields : Mysql.result -> Mysql.field array option
val fetch_field_dir : Mysql.result -> int -> Mysql.field option
val escape : string -> string
val real_escape : Mysql.dbd -> string -> string
val int2ml : string -> int
val decimal2ml : string -> string
val int322ml : string -> int32
val nativeint2ml : string -> nativeint
val int642ml : string -> int64
val float2ml : string -> float
val str2ml : string -> string
val enum2ml : string -> string
val blob2ml : string -> string
val set2ml : string -> string list
val datetime2ml : string -> int * int * int * int * int * int
val date2ml : string -> int * int * int
val time2ml : string -> int * int * int
val year2ml : string -> int
val timestamp2ml : string -> int * int * int * int * int * int
val opt : ('a -> 'b) -> 'a option -> 'b option
val not_null : ('a -> 'b) -> 'a option -> 'b
val ml2str : string -> string
val ml2rstr : Mysql.dbd -> string -> string
val ml2blob : string -> string
val ml2rblob : Mysql.dbd -> string -> string
val ml2int : int -> string
val ml2decimal : string -> string
val ml322int : int32 -> string
val ml642int : int64 -> string
val ml2float : float -> string
val ml2enum : string -> string
val ml2renum : Mysql.dbd -> string -> string
val ml2set : string list -> string
val ml2rset : Mysql.dbd -> string list -> string
val ml2datetime : int * int * int * int * int * int -> string
val ml2datetimel :
year:int ->
month:int -> day:int -> hour:int -> min:int -> sec:int -> string
val ml2date : int * int * int -> string
val ml2datel : year:int -> month:int -> day:int -> string
val ml2time : int * int * int -> string
val ml2timel : hour:int -> min:int -> sec:int -> string
val ml2year : int -> string
val ml2timestamp : int * int * int * int * int * int -> string
val ml2timestampl :
year:int ->
month:int -> day:int -> hour:int -> min:int -> sec:int -> string
val values : string list -> string
module Prepared :
sig
type stmt
type stmt_result
val create : Mysql.dbd -> string -> Mysql.Prepared.stmt
val execute :
Mysql.Prepared.stmt -> string array -> Mysql.Prepared.stmt_result
val execute_null :
Mysql.Prepared.stmt ->
string option array -> Mysql.Prepared.stmt_result
val affected : Mysql.Prepared.stmt -> int64
val insert_id : Mysql.Prepared.stmt -> int64
val real_status : Mysql.Prepared.stmt -> int
val fetch : Mysql.Prepared.stmt_result -> string option array option
val result_metadata : Mysql.Prepared.stmt -> Mysql.result
val close : Mysql.Prepared.stmt -> unit
end
end`