package current

  1. Overview
  2. Docs

Low-level database access (for the web UI and plugins).

type entry = {
  1. job_id : string;
  2. build : int64;
  3. value : string;
  4. outcome : string Current.or_error;
  5. ready : float;
  6. running : float option;
  7. finished : float;
  8. rebuild : bool;
}
val init : unit -> unit

Ensure that the database tables have been created. This is useful if you need to refer to them in your own SQL.

val query : ?op:string -> ?ok:bool -> ?rebuild:bool -> ?job_prefix:string -> unit -> entry list

Search the database for matching records.

  • parameter op

    : if present, restrict to results from the named builder or publisher

  • parameter ok

    : if present, restrict results to passing (ok=true) or failing (ok=false) results.

  • parameter rebuild

    : if present, restrict results to ones where the rebuild flag matches this.

  • parameter job_prefix

    : if present, restrict results to ones where the job ID starts with this string.

val ops : unit -> string list

ops () is the list of operation types that can be passed to query.

val history : limit:int -> job_id:string -> string option * entry list

history ~limit ~job_id returns the in-progress build (if any), and the limit most recent builds with the same key as job_id.

OCaml

Innovation. Community. Security.