table t1 : {A : int, B : string, C : float, D : bool}
fun display (q : sql_query [T1 = [A = int, B = string, C = float, D = bool]] []) =
s <- query q
(fn fs _ => return (Some fs.T1))
None;
return
{case s of
None => cdata "Row not found."
| Some s =>
A: {cdata (show _ s.A)}
B: {cdata (show _ s.B)}
C: {cdata (show _ s.C)}
D: {cdata (show _ s.D)}
}
fun lookupA (inp : {A : string}) =
display (SELECT * FROM t1 WHERE t1.A = {readError _ inp.A})
fun lookupB (inp : {B : string}) =
display (SELECT * FROM t1 WHERE t1.B = {inp.B})
fun lookupC (inp : {C : string}) =
display (SELECT * FROM t1 WHERE t1.C = {readError _ inp.C})
fun lookupD (inp : {D : string}) =
display (SELECT * FROM t1 WHERE t1.D = {readError _ inp.D})
fun main () : transaction page = return
A:
B:
C:
D: