# HG changeset patch # User Adam Chlipala # Date 1220809867 14400 # Node ID cde1ec47f3afac606b22f70e0cb0e31b97830fe9 # Parent 5f6a60b7ab0084928172c16de297b5b5ee27155d Elaborated 'update' diff -r 5f6a60b7ab00 -r cde1ec47f3af lib/basis.urs --- a/lib/basis.urs Sun Sep 07 13:47:10 2008 -0400 +++ b/lib/basis.urs Sun Sep 07 13:51:07 2008 -0400 @@ -209,8 +209,8 @@ -> dml val update : changed ::: {Type} -> unchanged ::: {Type} -> changed ~ unchanged + -> $changed -> sql_table (changed ++ unchanged) - -> $changed -> sql_exp [T = changed ++ unchanged] [] [] bool -> dml diff -r 5f6a60b7ab00 -r cde1ec47f3af src/urweb.grm --- a/src/urweb.grm Sun Sep 07 13:47:10 2008 -0400 +++ b/src/urweb.grm Sun Sep 07 13:51:07 2008 -0400 @@ -726,6 +726,7 @@ (EPrim (Prim.String ""), s (XML_BEGINleft, XML_ENDright))), s (XML_BEGINleft, XML_ENDright)) | LPAREN query RPAREN (query) + | LPAREN CWHERE sqlexp RPAREN (sqlexp) | UNDER (EWild, s (UNDERleft, UNDERright)) idents : ident ([ident]) diff -r 5f6a60b7ab00 -r cde1ec47f3af tests/update.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/update.ur Sun Sep 07 13:51:07 2008 -0400 @@ -0,0 +1,5 @@ +table t1 : {A : int, B : string, C : float, D : bool} + +fun main () : transaction page = + () <- dml (update {B = "6", C = 7.0} t1 (WHERE T.A = 5)); + return Updated. diff -r 5f6a60b7ab00 -r cde1ec47f3af tests/update.urp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/update.urp Sun Sep 07 13:51:07 2008 -0400 @@ -0,0 +1,6 @@ +debug +database dbname=test +exe /tmp/webapp +sql /tmp/urweb.sql + +update