-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrud.urs
More file actions
53 lines (37 loc) · 1.76 KB
/
crud.urs
File metadata and controls
53 lines (37 loc) · 1.76 KB
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
50
51
52
53
con colMeta = fn (db :: Type, widget :: Type) =>
{Nam : string,
Show : db -> xbody,
Widget : nm :: Name -> xml form [] [nm = widget],
WidgetPopulated : nm :: Name -> db -> xml form [] [nm = widget],
Parse : widget -> db,
Inject : sql_injectable db}
con colsMeta = fn cols :: {(Type * Type)} => $(map colMeta cols)
val int : string -> colMeta (int, string)
val float : string -> colMeta (float, string)
val string : string -> colMeta (string, string)
val option_string : string -> colMeta (option string, string)
val bool : string -> colMeta (bool, bool)
val option_bool : string -> colMeta (option bool, bool)
val time : string -> colMeta (time, string)
functor Make(M : sig
con cols :: {(Type * Type)}
type key_type
con key :: Name
constraint [key] ~ cols
val fl : folder ([key = (key_type, key_type)] ++ cols)
table tab : ([key = key_type] ++ map fst cols)
val title : string
(* val defid : key_type *)
val prim_show : show key_type
val prim_sql_injectable : sql_injectable key_type
val everything : colsMeta ([key = (key_type, key_type)] ++ cols)
val defpage : string -> xbody -> page
val hdrpage : string -> xbody -> xbody -> page
type task_type
val runTask : task_type -> key_type -> transaction page
val taskTitle : task_type -> string
val allTasks : list task_type
val header : transaction xbody
end) : sig
val main : unit -> transaction page
end