forked from links-lang/links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.mli
28 lines (18 loc) · 1.21 KB
/
database.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(** A generic interface for SQL-style databases. Vendor-specific implementations are elsewhere *)
class virtual db_args : string -> object
val strval : string
method virtual from_string : string -> unit
end
val value_of_db_string : string -> Types.datatype -> Value.t
val execute_command : (string -> Value.database -> Value.t)
(* Builds raw dbvalue with mapping from names to types and positions *)
val execute_select_result : (string * Types.datatype) list -> string -> Value.database -> Value.dbvalue * (string * (Types.datatype * int)) list
val build_result : Value.dbvalue * (string * (Types.datatype * int)) list -> Value.t
(** [execute_select \[row1; row2; ...\] sql db] runs the query [sql]
on the database [db] and interprets the results according to the
field types of the [row]i. This should really take an alist of
fieldname -> fieldtype. *)
val execute_select : (string * Types.datatype) list -> string -> Value.database -> Value.t
val execute_untyped_select : string -> Value.database -> Value.t
val execute_insert : (string * string list * string list list) -> Value.database -> Value.t
val execute_insert_returning : (string * string list * string list list * string) -> Value.database -> Value.t