web page is managed elsewhere
[sqlgg.git] / src / stmt.ml
blobf064d13381e55aff1811642afdaace6d56ba18b8
1 (** Statement *)
3 open Printf
4 open ExtString
5 open ListMore
7 (** optional name and start/end position in string *)
8 type param_id = string option * (int * int) deriving (Show)
9 type param = param_id * Sql.Type.t deriving (Show)
10 type params = param list deriving (Show)
12 let params_to_string ps = Show.show<params>(ps)
14 type insert_kind = Values | Assign deriving(Show)
16 (** inferred inserted values to complete sql statement *)
17 type inferred = (insert_kind * RA.Schema.t) option deriving(Show)
19 type kind = | Select of bool (** true if result is single row *)
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; }