Mercurial > urweb
comparison lib/ur/top.ur @ 1006:5a0f6ec208ce
Checking deadline; sign-in
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 22 Oct 2009 11:15:37 -0400 |
parents | a87495bcaeec |
children | 5d9f47124c4c |
comparison
equal
deleted
inserted
replaced
1005:c6e948ec79e9 | 1006:5a0f6ec208ce |
---|---|
244 fun oneOrNoRows1 [nm ::: Name] [fs ::: {Type}] (q : sql_query [nm = fs] []) = | 244 fun oneOrNoRows1 [nm ::: Name] [fs ::: {Type}] (q : sql_query [nm = fs] []) = |
245 query q | 245 query q |
246 (fn fs _ => return (Some fs.nm)) | 246 (fn fs _ => return (Some fs.nm)) |
247 None | 247 None |
248 | 248 |
249 fun oneOrNoRowsE1 [tab ::: Name] [nm ::: Name] [t ::: Type] [[tab] ~ [nm]] (q : sql_query [tab = []] [nm = t]) = | |
250 query q | |
251 (fn fs _ => return (Some fs.nm)) | |
252 None | |
253 | |
249 fun oneRow [tables ::: {{Type}}] [exps ::: {Type}] | 254 fun oneRow [tables ::: {{Type}}] [exps ::: {Type}] |
250 [tables ~ exps] (q : sql_query tables exps) = | 255 [tables ~ exps] (q : sql_query tables exps) = |
251 o <- oneOrNoRows q; | 256 o <- oneOrNoRows q; |
252 return (case o of | 257 return (case o of |
253 None => error <xml>Query returned no rows</xml> | 258 None => error <xml>Query returned no rows</xml> |