Mercurial > urweb
comparison tests/crud1.ur @ 339:075b36dbb1a4
Crud supports INSERT
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 14 Sep 2008 15:10:04 -0400 |
parents | 34847732cefc |
children | 389399d65331 |
comparison
equal
deleted
inserted
replaced
338:e976b187d73a | 339:075b36dbb1a4 |
---|---|
1 table t1 : {Id : int, A : int, B : string, C : float, D : bool} | 1 table t1 : {Id : int, A : int, B : string, C : float, D : bool} |
2 | 2 |
3 open Crud.Make(struct | 3 open Crud.Make(struct |
4 con cols :: {(Type * Type)} = [ | |
5 A = (int, string), | |
6 B = (string, string), | |
7 C = (float, string), | |
8 D = (bool, string) | |
9 ] | |
10 | |
4 val tab = t1 | 11 val tab = t1 |
5 | 12 |
6 val title = "Crud1" | 13 val title = "Crud1" |
7 | 14 |
8 val cols = { | 15 val cols = { |
9 A = {Nam = "A", Show = txt _}, | 16 A = { |
10 B = {Nam = "B", Show = txt _}, | 17 Nam = "A", |
11 C = {Nam = "C", Show = txt _}, | 18 Show = txt _, |
12 D = {Nam = "D", Show = txt _} | 19 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, |
20 Parse = readError _, | |
21 Inject = sql_int | |
22 }, | |
23 B = { | |
24 Nam = "B", | |
25 Show = txt _, | |
26 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | |
27 Parse = readError _, | |
28 Inject = sql_string | |
29 }, | |
30 C = { | |
31 Nam = "C", | |
32 Show = txt _, | |
33 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | |
34 Parse = readError _, | |
35 Inject = sql_float | |
36 }, | |
37 D = { | |
38 Nam = "D", | |
39 Show = txt _, | |
40 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | |
41 Parse = readError _, | |
42 Inject = sql_bool | |
43 } | |
13 } | 44 } |
14 end) | 45 end) |