summaryrefslogtreecommitdiff
path: root/tests/crud1.ur
blob: fa539dd31b550a3ecd8887448bbc6ab64149f367 (plain)
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
table t1 : {Id : int, A : int, B : string, C : float, D : bool}

open Crud.Make(struct
        con cols :: {(Type * Type)} = [
                A = (int, string),
                B = (string, string),
                C = (float, string),
                D = (bool, string)
        ]

        val tab = t1

        val title = "Crud1"

        val cols = {
                A = {
                        Nam = "A",
                        Show = txt _,
                        Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
                        Parse = readError _,
                        Inject = sql_int
                    },
                B = {
                        Nam = "B",
                        Show = txt _,
                        Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
                        Parse = readError _,
                        Inject = sql_string
                    },
                C = {
                        Nam = "C",
                        Show = txt _,
                        Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
                        Parse = readError _,
                        Inject = sql_float
                    },
                D = {
                        Nam = "D",
                        Show = txt _,
                        Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
                        Parse = readError _,
                        Inject = sql_bool
                    }
        }
end)