Mercurial > urweb
comparison demo/more/orm.ur @ 991:b132f8620a66
Initial Orm1 demo
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 06 Oct 2009 10:34:27 -0400 |
parents | 46803e668a89 |
children | bb3fc575cfe7 |
comparison
equal
deleted
inserted
replaced
990:46803e668a89 | 991:b132f8620a66 |
---|---|
1 con link = fn col_parent :: (Type * Type) => col_parent.1 -> transaction (option col_parent.2) | 1 con link = fn col_parent :: (Type * Type) => col_parent.1 -> transaction (option col_parent.2) |
2 fun noParent [t ::: Type] _ = return None | 2 fun noParent [t ::: Type] (_ : t) = return None |
3 | 3 |
4 con meta = fn col_parent :: (Type * Type) => { | 4 con meta = fn col_parent :: (Type * Type) => { |
5 Link : link col_parent, | 5 Link : link col_parent, |
6 Inj : sql_injectable col_parent.1 | 6 Inj : sql_injectable col_parent.1 |
7 } | 7 } |
8 | |
9 fun local [t :: Type] (inj : sql_injectable t) = {Link = noParent, | |
10 Inj = inj} | |
8 | 11 |
9 functor Table(M : sig | 12 functor Table(M : sig |
10 con cols :: {(Type * Type)} | 13 con cols :: {(Type * Type)} |
11 val cols : $(map meta cols) | 14 val cols : $(map meta cols) |
12 constraint [Id] ~ cols | 15 constraint [Id] ~ cols |