comparison src/sql.sig @ 2204:01c8aceac480

Finishes initial prototype, caching parameterless pages with table-match-based invalidation. Still has problems parsing non-Postgres SQL dialects properly.
author Ziv Scully <ziv@mit.edu>
date Tue, 27 May 2014 21:14:13 -0400
parents 39faa4a037f4
children 388ba4dc7c96
comparison
equal deleted inserted replaced
2203:39faa4a037f4 2204:01c8aceac480
1 signature SQL = sig 1 signature SQL = sig
2
3 val fu : Mono.file -> unit
4 2
5 val debug : bool ref 3 val debug : bool ref
6 4
7 type lvar 5 type lvar = int
8 6
9 datatype func = 7 datatype func =
10 DtCon0 of string 8 DtCon0 of string
11 | DtCon1 of string 9 | DtCon1 of string
12 | UnCon of string 10 | UnCon of string
39 | And of prop * prop 37 | And of prop * prop
40 | Or of prop * prop 38 | Or of prop * prop
41 | Reln of reln * exp list 39 | Reln of reln * exp list
42 | Cond of exp * prop 40 | Cond of exp * prop
43 41
44 datatype ('a, 'b) sum = inl of 'a | inr of 'b 42 datatype chunk =
43 String of string
44 | Exp of Mono.exp
45
46 type 'a parser = chunk list -> ('a * chunk list) option
47
48 val parse : 'a parser -> Mono.exp -> 'a option
45 49
46 datatype Rel = 50 datatype Rel =
47 Exps of exp * exp -> prop 51 Exps of exp * exp -> prop
48 | Props of prop * prop -> prop 52 | Props of prop * prop -> prop
49 53
59 | Inj of Mono.exp 63 | Inj of Mono.exp
60 | SqFunc of string * sqexp 64 | SqFunc of string * sqexp
61 | Unmodeled 65 | Unmodeled
62 | Null 66 | Null
63 67
68 datatype ('a,'b) sum = inl of 'a | inr of 'b
69
64 datatype sitem = 70 datatype sitem =
65 SqField of string * string 71 SqField of string * string
66 | SqExp of sqexp * string 72 | SqExp of sqexp * string
67 73
68 type query1 74 type query1 = {Select : sitem list,
75 From : (string * string) list,
76 Where : sqexp option}
69 77
70 datatype query = 78 datatype query =
71 Query1 of query1 79 Query1 of query1
72 | Union of query * query 80 | Union of query * query
81
82 val query : query parser
73 83
74 datatype dml = 84 datatype dml =
75 Insert of string * (string * sqexp) list 85 Insert of string * (string * sqexp) list
76 | Delete of string * sqexp 86 | Delete of string * sqexp
77 | Update of string * (string * sqexp) list * sqexp 87 | Update of string * (string * sqexp) list * sqexp
78 88
89 val dml : dml parser
90
79 end 91 end