comparison tests/crud.urs @ 362:24a31b35e08f

Reusable column handlers for Crud
author Adam Chlipala <adamc@hcoop.net>
date Tue, 14 Oct 2008 17:18:59 -0400
parents 2205d5cb416a
children 4f75cc2e1373
comparison
equal deleted inserted replaced
361:260b680a6a04 362:24a31b35e08f
5 WidgetPopulated : nm :: Name -> t_formT.1 5 WidgetPopulated : nm :: Name -> t_formT.1
6 -> xml form [] [nm = t_formT.2], 6 -> xml form [] [nm = t_formT.2],
7 Parse : t_formT.2 -> t_formT.1, 7 Parse : t_formT.2 -> t_formT.1,
8 Inject : sql_injectable t_formT.1} 8 Inject : sql_injectable t_formT.1}
9 con colsMeta = fn cols :: {(Type * Type)} => $(mapT2T colMeta cols) 9 con colsMeta = fn cols :: {(Type * Type)} => $(mapT2T colMeta cols)
10
11 val default : t ::: Type -> show t -> read t -> sql_injectable t -> string -> colMeta (t, string)
12 val int : string -> colMeta (int, string)
13 val float : string -> colMeta (float, string)
14 val string : string -> colMeta (string, string)
15 val bool : string -> colMeta (bool, bool)
10 16
11 functor Make(M : sig 17 functor Make(M : sig
12 con cols :: {(Type * Type)} 18 con cols :: {(Type * Type)}
13 constraint [Id] ~ cols 19 constraint [Id] ~ cols
14 val tab : sql_table ([Id = int] ++ mapT2T fstTT cols) 20 val tab : sql_table ([Id = int] ++ mapT2T fstTT cols)