Mercurial > urweb
comparison demo/crud.ur @ 455:d4a81273d4b1
Nested demo
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 04 Nov 2008 09:33:35 -0500 |
parents | c471345f5165 |
children | 20fab0e96217 |
comparison
equal
deleted
inserted
replaced
454:9163f8014f9b | 455:d4a81273d4b1 |
---|---|
98 (foldT2R2 [sndTT] [colMeta] | 98 (foldT2R2 [sndTT] [colMeta] |
99 [fn cols => $(mapT2T (fn t :: (Type * Type) => | 99 [fn cols => $(mapT2T (fn t :: (Type * Type) => |
100 sql_exp [] [] [] t.1) cols)] | 100 sql_exp [] [] [] t.1) cols)] |
101 (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) | 101 (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) |
102 [[nm] ~ rest] => | 102 [[nm] ~ rest] => |
103 fn input col acc => acc with nm = @sql_inject col.Inject (col.Parse input)) | 103 fn input col acc => acc ++ {nm = @sql_inject col.Inject (col.Parse input)}) |
104 {} [M.cols] inputs M.cols | 104 {} [M.cols] inputs M.cols |
105 with #Id = (SQL {id}))); | 105 ++ {Id = (SQL {id})})); |
106 ls <- list (); | 106 ls <- list (); |
107 return <xml><body> | 107 return <xml><body> |
108 <p>Inserted with ID {[id]}.</p> | 108 <p>Inserted with ID {[id]}.</p> |
109 | 109 |
110 {ls} | 110 {ls} |
117 sql_exp [T = [Id = int] | 117 sql_exp [T = [Id = int] |
118 ++ mapT2T fstTT M.cols] | 118 ++ mapT2T fstTT M.cols] |
119 [] [] t.1) cols)] | 119 [] [] t.1) cols)] |
120 (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) | 120 (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) |
121 [[nm] ~ rest] => | 121 [[nm] ~ rest] => |
122 fn input col acc => acc with nm = | 122 fn input col acc => acc ++ {nm = |
123 @sql_inject col.Inject (col.Parse input)) | 123 @sql_inject col.Inject (col.Parse input)}) |
124 {} [M.cols] inputs M.cols) | 124 {} [M.cols] inputs M.cols) |
125 tab (WHERE T.Id = {id})); | 125 tab (WHERE T.Id = {id})); |
126 ls <- list (); | 126 ls <- list (); |
127 return <xml><body> | 127 return <xml><body> |
128 <p>Saved!</p> | 128 <p>Saved!</p> |