-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataType.ml
53 lines (35 loc) · 1.14 KB
/
dataType.ml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module StringTable =
struct
type t = string
let compare = compare
end
module StringMap = Map.Make(StringTable)
type op = Eq | Lt
type idstring = ID of string * string
type coltype = | CID of string * string
| Max of idstring
| Min of idstring
| Count of idstring
| Avg of idstring
| Sum of idstring
type column = Col of coltype
| Rename of coltype * string
type cond =
And of cond * cond
| Or of cond * cond
| Rel of idstring * op * idstring
| In of idstring * requete
| NotIn of idstring * requete
and liretable = | File of string * string
| Req of requete * string
and requeteWhere =
{col: column list; (* liste des colonnes que l'on sélectionne *)
table: liretable list; (* table dans le join *)
cond: cond; (* condition dans le where *)
}
and requete =
| Where of requeteWhere
| Union of requete * requete
| Minus of requete * requete
| Group of requete * idstring (* group by que sur une seule colonne *)
| Order of requete * column list