package mariadb

  1. Overview
  2. Docs

The module containing operations on MariaDB query results.

type t

The type of query results.

val num_rows : t -> int

num_rows res returns the number of rows in result res after the execution of a SELECT-type query.

val affected_rows : t -> int

affected_rows res returns the number of affected rows in result res after the execution of an INSERT or UPDATE-type query.

val insert_id : t -> int

insert_id res returns the ID generated by a prepared statement on a table with a column having the AUTO_INCREMENT attribute. If the last query wasn't an INSERT or UPDATE statement or if the modified table does not have a column with the AUTO_INCREMENT attribute, this function will return zero.

val fetch : (module Row.S with type t = 'r) -> t -> 'r option result

fetch (module M : Row.S) res fetches the next available row from res, returning it in as the data structure specified by module M. Returns None when no more rows are available.

OCaml

Innovation. Community. Security.