Mercurial > urweb
comparison lib/ur/top.ur @ 1064:b89e3d8731ed
Make oneRowE1 more general
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 10 Dec 2009 12:06:03 -0500 |
parents | 5d9f47124c4c |
children | 9001966ae1c8 |
comparison
equal
deleted
inserted
replaced
1063:e3f6620afd51 | 1064:b89e3d8731ed |
---|---|
256 o <- oneOrNoRows q; | 256 o <- oneOrNoRows q; |
257 return (case o of | 257 return (case o of |
258 None => error <xml>Query returned no rows</xml> | 258 None => error <xml>Query returned no rows</xml> |
259 | Some r => r) | 259 | Some r => r) |
260 | 260 |
261 fun oneRowE1 [tab ::: Name] [nm ::: Name] [t ::: Type] [[tab] ~ [nm]] (q : sql_query [tab = []] [nm = t]) = | 261 fun oneRowE1 [tabs ::: {Unit}] [nm ::: Name] [t ::: Type] [tabs ~ [nm]] (q : sql_query (mapU [] tabs) [nm = t]) = |
262 o <- oneOrNoRows q; | 262 o <- oneOrNoRows q; |
263 return (case o of | 263 return (case o of |
264 None => error <xml>Query returned no rows</xml> | 264 None => error <xml>Query returned no rows</xml> |
265 | Some r => r.nm) | 265 | Some r => r.nm) |
266 | 266 |