(** A record which can be stored in the database with the [save]
function, or removed by calling [delete]. Changes are not
committed to the database until [save] is invoked. *)
(** {2 data} *)
valsave:handle->t->int64
(** The following define records which can be stored in the database
with the respective [save] functions, or removed by calling
[delete]. Changes are not committed to the database until
[save] is invoked. *)
valdelete:handle->t->unit
typedb_ident(* = int64 *)
(** hidden type for record unique identifiers *)
typeloc_record=private
{mutableid:db_identoption;
(** when None, the record has never been stored in database yet *)
mutablefile:string;
mutableline:int;
mutablestart:int;
mutablestop:int;
}
moduleLoc:sig
valsave:handle->loc_record->db_ident
(** [save db loc] saves [loc] in database [db]. The record is created
if it does not exist yet. {!save}
@return the index of the saved record, which is also equal to loc.id
*)
valdelete:handle->loc_record->unit
(** [delete db loc] removes the record from database {!delete} *)
valcreate:
?id:int64->
(* ?id:int64 -> *)
file:string->
line:int64->
start:int64->
stop:int64->
t
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered
*)
line:int->
start:int->
stop:int->
loc_record
(** Can be used to construct a new object. If [id] is not specified, it will be automatically assigned the first time [save] is called on the object. The object is not committed to the database until [save] is invoked. The [save] method will also return the [id] assigned to the object.
@raise Sql_error if a database error is encountered