diff --git a/index.html b/index.html index 5c7af35..f5bdb26 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@
Column.Float
Marshal.1-C
Column.Marshal
Column.String
1-Functorial.Column
Table.Variable
Table.1-T
Table.2-Key
Table.3-Value
1-Functorial.Table
module T : sig ... end
type key = Key.t
type value = Value.t
val remove : key -> unit Lwt.t
module Variable : sig ... end
Polymorphic.1-Functorial
1-Functorial.COLUMN
Ocsipersist_lib.Polymorphic
deriving polymorphic interface from the functorial one
module Functorial : Sigs.FUNCTORIAL
val table_name : 'value table -> string Lwt.t
returns the name of the table
val open_table : string -> 'value table Lwt.t
Open a table (and create it if it does not exist)
val find : 'value table -> string -> 'value Lwt.t
find table key
gives the value associated to key
. Fails with Not_found
if not found.
val add : 'value table -> string -> 'value -> unit Lwt.t
add table key value
associates value
to key
. If the database already contains data associated with key
, that data is discarded and silently replaced by the new data.
val replace_if_exists : 'value table -> string -> 'value -> unit Lwt.t
replace_if_exists table key value
associates value
to key
only if key
is already bound. If the database does not contain any data associated with key
, fails with Not_found
.
val remove : 'value table -> string -> unit Lwt.t
remove table key
removes the entry in the table if it exists
val length : 'value table -> int Lwt.t
Size of a table.
val iter_step : (string -> 'a -> unit Lwt.t) -> 'a table -> unit Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val fold_step : (string -> 'a -> 'b -> 'b Lwt.t) -> 'a table -> 'b -> 'b Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val iter_block : (string -> 'a -> unit) -> 'a table -> unit Lwt.t
MAJOR WARNING: Unlike iter_step, this iterator won't miss any entry and will run in one shot. It is therefore more efficient, BUT: it will lock the WHOLE database during its execution, thus preventing ANYBODY from accessing it (including the function f which is iterated). As a consequence: you MUST NOT use any function from ocsipersist in f, otherwise you would lock yourself and everybody else! Be VERY cautious.
Ocsipersist_lib.Sigs
module type TABLE = sig ... end
module type FUNCTORIAL = sig ... end
module type POLYMORPHIC = sig ... end
module type STORE = sig ... end
Column.Float
Marshal.1-C
Column.Marshal
Column.String
FUNCTORIAL.Column
Table.Variable
Table.1-T
Table.2-Key
Table.3-Value
FUNCTORIAL.Table
module T : sig ... end
type key = Key.t
type value = Value.t
val remove : key -> unit Lwt.t
module Variable : sig ... end
Sigs.FUNCTORIAL
FUNCTORIAL.COLUMN
Sigs.POLYMORPHIC
val table_name : 'value table -> string Lwt.t
returns the name of the table
val open_table : string -> 'value table Lwt.t
Open a table (and create it if it does not exist)
val find : 'value table -> string -> 'value Lwt.t
find table key
gives the value associated to key
. Fails with Not_found
if not found.
val add : 'value table -> string -> 'value -> unit Lwt.t
add table key value
associates value
to key
. If the database already contains data associated with key
, that data is discarded and silently replaced by the new data.
val replace_if_exists : 'value table -> string -> 'value -> unit Lwt.t
replace_if_exists table key value
associates value
to key
only if key
is already bound. If the database does not contain any data associated with key
, fails with Not_found
.
val remove : 'value table -> string -> unit Lwt.t
remove table key
removes the entry in the table if it exists
val length : 'value table -> int Lwt.t
Size of a table.
val iter_step : (string -> 'a -> unit Lwt.t) -> 'a table -> unit Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val fold_step : (string -> 'a -> 'b -> 'b Lwt.t) -> 'a table -> 'b -> 'b Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val iter_block : (string -> 'a -> unit) -> 'a table -> unit Lwt.t
MAJOR WARNING: Unlike iter_step, this iterator won't miss any entry and will run in one shot. It is therefore more efficient, BUT: it will lock the WHOLE database during its execution, thus preventing ANYBODY from accessing it (including the function f which is iterated). As a consequence: you MUST NOT use any function from ocsipersist in f, otherwise you would lock yourself and everybody else! Be VERY cautious.
Sigs.STORE
Data are divided into stores. Create one store for your project, where you will save all your data.
val open_store : string -> store Lwt.t
Open a store (and create it if it does not exist)
make_persistent store name default
find a persistent value named name
in store store
from database, or create it with the default value default
if it does not exist.
Same as make_persistent but the default value is evaluated only if needed
val make_persistent_lazy_lwt : store:store -> name:string -> default:(unit -> 'a Lwt.t) ->
-'a t Lwt.t
Lwt version of make_persistent_lazy.
val get : 'a t -> 'a Lwt.t
get pv
gives the value of pv
val set : 'a t -> 'a -> unit Lwt.t
set pv value
sets a persistent value pv
to value
TABLE.Variable
Sigs.TABLE
Variable.1-T
Ocsipersist_lib.Variable
Column.Float
Marshal.1-C
Column.Marshal
Column.String
Functorial.Column
Table.Variable
Table.1-T
Table.2-Key
Table.3-Value
Functorial.Table
module T : sig ... end
type key = Key.t
type value = Value.t
val remove : key -> unit Lwt.t
module Variable : sig ... end
Ocsipersist.Functorial
Functorial frontent. Allows for custom (de)serialisation functions, which keeps data human-readable in the backend.
Functorial.COLUMN
Ocsipersist.Polymorphic
Polymorphic frontent. Relies on Marshal
for (de)serialisation, which means that data will be stored in the backend in a fashion that is not necessarily easily readable by non-OCaml-based life forms. If this is an issue for you, you can rely on the functorial frontend instead.
val table_name : 'value table -> string Lwt.t
returns the name of the table
val open_table : string -> 'value table Lwt.t
Open a table (and create it if it does not exist)
val find : 'value table -> string -> 'value Lwt.t
find table key
gives the value associated to key
. Fails with Not_found
if not found.
val add : 'value table -> string -> 'value -> unit Lwt.t
add table key value
associates value
to key
. If the database already contains data associated with key
, that data is discarded and silently replaced by the new data.
val replace_if_exists : 'value table -> string -> 'value -> unit Lwt.t
replace_if_exists table key value
associates value
to key
only if key
is already bound. If the database does not contain any data associated with key
, fails with Not_found
.
val remove : 'value table -> string -> unit Lwt.t
remove table key
removes the entry in the table if it exists
val length : 'value table -> int Lwt.t
Size of a table.
val iter_step : (string -> 'a -> unit Lwt.t) -> 'a table -> unit Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val fold_step : (string -> 'a -> 'b -> 'b Lwt.t) -> 'a table -> 'b -> 'b Lwt.t
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
val iter_block : (string -> 'a -> unit) -> 'a table -> unit Lwt.t
MAJOR WARNING: Unlike iter_step, this iterator won't miss any entry and will run in one shot. It is therefore more efficient, BUT: it will lock the WHOLE database during its execution, thus preventing ANYBODY from accessing it (including the function f which is iterated). As a consequence: you MUST NOT use any function from ocsipersist in f, otherwise you would lock yourself and everybody else! Be VERY cautious.
Ocsipersist.Store
The variable store allows for the persistent storage of individual variables. Relies on Stdlib
.Marshal for (de)serialisation, which entails the same limitations as for the Polymorphic
frontend. If this is an issue you can rely on Functorial
frontend instead (see TABLE.Variable
).
Data are divided into stores. Create one store for your project, where you will save all your data.
val open_store : string -> store Lwt.t
Open a store (and create it if it does not exist)
make_persistent store name default
find a persistent value named name
in store store
from database, or create it with the default value default
if it does not exist.
Same as make_persistent but the default value is evaluated only if needed
val make_persistent_lazy_lwt : store:store -> name:string -> default:(unit -> 'a Lwt.t) ->
-'a t Lwt.t
Lwt version of make_persistent_lazy.
val get : 'a t -> 'a Lwt.t
get pv
gives the value of pv
val set : 'a t -> 'a -> unit Lwt.t
set pv value
sets a persistent value pv
to value