sig
exception End_results
exception End_data
exception Cancelled
exception Cmd_fail
exception Datatype_not_implemented
type binding_buffer
and context
and connection
and command
and prop_action = [ `Clear | `Get | `Set ]
and string_property = [ `Appname | `Password | `Username ]
and cmd_type = [ `Lang | `Rpc ]
and cmd_option = [ `NoRecompile | `Recompile ]
and result_type =
[ `Cmd_done | `Cmd_fail | `Cmd_succeed | `Param | `Row | `Status ]
and resinfo_type = [ `Cmd_number | `Numdata | `Row_count ]
and status = [ `CanBeNull | `Identity | `NoData | `Return ]
and column = {
col_name : string;
col_status : Ct.status list;
col_buffer : Ct.binding_buffer;
}
and location = [ `Client | `Server ]
and severity =
[ `Api_fail
| `Comm_fail
| `Config_fail
| `Fatal
| `Inform
| `Internal_fail
| `Resource_fail
| `Retry_fail ]
and sql_t =
[ `Binary of string
| `Bit of bool
| `Datetime of string
| `Decimal of string
| `Float of float
| `Int of int32
| `Null
| `Smallint of int
| `String of string
| `Text of string
| `Tinyint of int ]
external ctx_create : unit -> Ct.context = "mltds_cs_ctx_create"
external con_alloc : Ct.context -> Ct.connection = "mltds_ct_con_alloc"
external con_setstring :
Ct.connection -> Ct.string_property -> string -> unit
= "mltds_ct_con_setstring"
external connect : Ct.connection -> string -> unit = "mltds_ct_connect"
val close : ?force:bool -> Ct.connection -> unit
external cmd_alloc : Ct.connection -> Ct.command = "mltds_ct_cmd_alloc"
external command :
Ct.command -> Ct.cmd_type -> ?option:Ct.cmd_option -> string -> unit
= "mltds_ct_command"
external send : Ct.command -> unit = "mltds_ct_send"
external results : Ct.command -> Ct.result_type = "mltds_ct_results"
external res_info : Ct.command -> Ct.resinfo_type -> int
= "mltds_ct_res_info"
external fetch : Ct.command -> int = "mltds_ct_fetch"
val bind : Ct.command -> ?maxlen:int -> int -> Ct.column
external buffer_contents : Ct.binding_buffer -> Ct.sql_t
= "mltds_buffer_contents"
external get_messages :
Ct.connection -> Ct.location list -> (Ct.severity * string) list
= "mltds_get_messages"
end