Module Mysql


module Mysql: sig  end
Interpret and perform MySQL queries

val connect : string -> string -> string -> string -> int -> int
Starts a new connection Mysql.connect host user password database tcp_port unix_socket returns an identifier for this connection that should be passed on to all the operations on this connection. Empty values or zeros given to parameters indicate default behaviour.
val query : int -> string -> int * int
This connection is used for this query and the result is a tuple with the number to be used to read the records and the number of affected records by the query
val record : int -> (string * string) list
Return a single record from a query-id inside a set of pairs (fieldname, value), an empty list marks the end of the table or empty results
val close : int -> unit
Closes this connection
val scan : string -> string * string list
Scans a query for expressions between question marks and creates a tuple with the expression to build the query and the list of field names of the resulting records.

To be compatible to the future use of prepared queries (MySQL 4.1 and later) the question mark expressions can only replace normal contants in the query. The prepared statements will be available when MySQL 4.1 becomes the normal stable MySQL soon.

Examples: insert into table address (name, address, job) value (?name?, ?address?, ?job?)

select 'dear '+name as opening, address where job like ?job_filter?

val finish : unit -> unit
Finished database connections, free allocated data
val enum : int -> string -> string -> string
Get the list of possible enumerate values. enum connection table field