package mariadb

  1. Overview
  2. Docs

Module Blocking.ResSource

The module containing operations on MariaDB query results.

Sourcetype t

The type of query results.

Sourceval num_rows : t -> int

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

Sourceval 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.

Sourceval 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.

Sourceval 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.