summaryrefslogtreecommitdiff
path: root/tests/sql_option.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 15:52:13 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 15:52:13 -0500
commit5b41c32b3fb60944fd5d342f7f6ee4413510b9f5 (patch)
tree41ee93be96f6a864b32ea4dc473be7a2c8414be2 /tests/sql_option.ur
parent2b028daf3ff279b9c68301c031588ab042edddf5 (diff)
Ensql'ing nullables
Diffstat (limited to 'tests/sql_option.ur')
-rw-r--r--tests/sql_option.ur16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/sql_option.ur b/tests/sql_option.ur
index 257f8c55..0676c907 100644
--- a/tests/sql_option.ur
+++ b/tests/sql_option.ur
@@ -4,9 +4,13 @@ fun addNull () =
dml (INSERT INTO t (O) VALUES (NULL));
return <xml>Done</xml>
-(*fun add42 () =
- dml (INSERT INTO t (O) VALUES (42));
- return <xml>Done</xml>*)
+fun add3 () =
+ dml (INSERT INTO t (O) VALUES ({Some 3}));
+ return <xml>Done</xml>
+
+fun addN r =
+ dml (INSERT INTO t (O) VALUES ({Some (readError r.N)}));
+ return <xml>Done</xml>
fun main () : transaction page =
xml <- queryX (SELECT * FROM t)
@@ -17,6 +21,8 @@ fun main () : transaction page =
{xml}
<a link={addNull ()}>Add a null</a><br/>
+ <a link={add3 ()}>Add a 3</a><br/>
+ <form>
+ Add <textbox{#N}/> <submit action={addN}/>
+ </form>
</body></xml>
-
-(* <a link={add42 ()}>Add a 42</a><br/>*)