Commit 67841fd6 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

rm

parent 2902a8b4
(* autogenerated by sql_orm *)
(** Use the [[Init]] module to open a new database handle. Each object type has its own module with functions to create, modify, save and destroy objects of that type into the SQLite database
*)
module Init : sig
type t
type transaction_mode = [`Exclusive |`Deferred |`Immediate ]
(** Database handle which can be used to create and retrieve objects
*)
val t :
?busyfn:(Sqlite3.db -> unit) -> ?mode:transaction_mode ->
string -> t
(** [t db_name] open a Sqlite3 database with filename [db_name] and create any tables if they are missing. @return a database handle which can be used to create and retrieve objects in the database.
@raise Sql_error if a database error is encountered
*)
val db: t -> Sqlite3.db
(** [db handle] @return the underlying Sqlite3 database handle for the connection, for advanced queries.
*)
end
module Challenge : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
log : int64;
set_log : int64 -> unit;
input : string;
set_input : string -> unit;
answer : string option;
set_answer : string option -> unit;
time : float;
set_time : float -> unit;
correct : int64;
set_correct : int64 -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
log:int64 ->
input:string ->
?answer:string option ->
time:float ->
correct:int64 ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?log:int64 option ->
?input:string option ->
?answer:string option ->
?time:float option ->
?correct:int64 option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
module Log_entry : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
attempt : int64;
set_attempt : int64 -> unit;
successful : int64;
set_successful : int64 -> unit;
starting_date : float;
set_starting_date : float -> unit;
end_date : float;
set_end_date : float -> unit;
challenges : Challenge.t list;
set_challenges : Challenge.t list -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
attempt:int64 ->
successful:int64 ->
starting_date:float ->
end_date:float ->
challenges:Challenge.t list ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?attempt:int64 option ->
?successful:int64 option ->
?starting_date:float option ->
?end_date:float option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
module Attempts : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
solution : int64;
set_solution : int64 -> unit;
log_entries : Log_entry.t list;
set_log_entries : Log_entry.t list -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
solution:int64 ->
log_entries:Log_entry.t list ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?solution:int64 option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
module Solution : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
user : string;
set_user : string -> unit;
problem_id : int64;
set_problem_id : int64 -> unit;
solved : int64;
set_solved : int64 -> unit;
attempts : Attempts.t list;
set_attempts : Attempts.t list -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
user:string ->
problem_id:int64 ->
solved:int64 ->
attempts:Attempts.t list ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?user:string option ->
?problem_id:int64 option ->
?solved:int64 option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
module Problems : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
number : int64;
set_number : int64 -> unit;
short_descr : string;
set_short_descr : string -> unit;
description : string;
set_description : string -> unit;
solved_by : int64;
set_solved_by : int64 -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
number:int64 ->
short_descr:string ->
description:string ->
solved_by:int64 ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?number:int64 option ->
?short_descr:string option ->
?description:string option ->
?solved_by:int64 option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
module User : sig
type t = <
id : int64 option;
set_id : int64 option -> unit;
username : string;
set_username : string -> unit;
password : string;
set_password : string -> unit;
email : string;
set_email : string -> unit;
allow_contact : int64;
set_allow_contact : int64 -> unit;
nationality : string option;
set_nationality : string option -> unit;
preferred_language : string option;
set_preferred_language : string option -> unit;
score : int64;
set_score : int64 -> unit;
solutions : Solution.t list;
set_solutions : Solution.t list -> unit;
save: int64; delete: unit
>
(** An object which can be stored in the database with the [save] method call, or removed by calling [delete]. Fields can be accessed via the approriate named method and set via the [set_] methods. Changes are not committed to the database until [save] is invoked.
*)
val t :
?id:int64 option ->
username:string ->
password:string ->
email:string ->
allow_contact:int64 ->
?nationality:string option ->
?preferred_language:string option ->
score:int64 ->
solutions:Solution.t list ->
Init.t -> 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
*)
val get :
?id:int64 option ->
?username:string option ->
?password:string option ->
?email:string option ->
?allow_contact:int64 option ->
?nationality:string option ->
?preferred_language:string option ->
?score:int64 option ->
?custom_where:string * Sqlite3.Data.t list -> Init.t -> t list
(** Used to retrieve objects from the database. If an argument is specified, it is included in the search criteria (all fields are ANDed together).
@raise Sql_error if a database error is encountered
*)
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment