package sqlite3_utils

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t

A cursor yielding values of type 'a

val ignore : _ t -> unit

Ignore this cursor

val next : 'a t -> 'a option

Get next value, or None if all values have been enumerated

val get_one : 'a t -> ('a, Rc.t) Stdlib.result

Get the first element (useful when querying a scalar, like "count( * )"). returns Error Rc.NOTFOUND if it's empty.

  • since 0.3
val get_one_exn : 'a t -> 'a

Same as get_one but raises an exception if the cursor is empty.

  • since 0.3
val iter : f:('a -> unit) -> 'a t -> unit

Iterate over the values

val map : f:('a -> 'b) -> 'a t -> 'b t

Map over values of the cursor. Once map ~f c is built, c should not be used.

val to_seq : 'a t -> 'a Stdlib.Seq.t

Lazy iterator over the values. Be careful not to let this leak outside the scope of a statement.

val to_list_rev : 'a t -> 'a list

Get a list of the values in the cursor, in reverse order. Faster than to_list

val to_list : 'a t -> 'a list

Get a list of the values in the cursor, in normal order. Slower than to_list

OCaml

Innovation. Community. Security.