start split library
[sqlgg.git] / lib / stmt.ml
blob8255ed68fdd50e63daa77160e6cde316c4f3c3e2
1 (** Statement *)
3 (** optional name and start/end position in string *)
4 type param_id = string option * (int * int) deriving (Show)
5 type param = param_id * Sql.Type.t deriving (Show)
6 type params = param list deriving (Show)
8 let params_to_string ps = Show.show<params>(ps)
10 type insert_kind = Values | Assign deriving(Show)
12 (** inferred inserted values to complete sql statement *)
13 type inferred = (insert_kind * RA.Schema.t) option deriving(Show)
15 type cardinality = [`Zero_one | `One | `Nat] deriving(Show)
17 let cardinality_to_string c = Show.show<cardinality>(c)
19 type kind = | Select of cardinality (** possible number of rows *)
20 | Insert of inferred * string (** table *)
21 | Create of string
22 | CreateIndex of string
23 | Update of string option (** name for single-table UPDATEs *)
24 | Delete of string
25 | Alter of string
26 | Drop of string
27 | Other
28 deriving (Show)
30 type t = { schema : RA.Schema.t; params : params; kind : kind; props : Props.t; }