# HG changeset patch # User Adam Chlipala # Date 1345639592 14400 # Node ID b8558b613abdfeeba8c305bed085dd77ce1cb0f1 # Parent b8fa7441e637b61e92b4b5234298fd85401e3843 show_sql_query diff -r b8fa7441e637 -r b8558b613abd lib/ur/basis.urs --- a/lib/ur/basis.urs Sat Aug 18 13:57:48 2012 -0400 +++ b/lib/ur/basis.urs Wed Aug 22 08:46:32 2012 -0400 @@ -641,6 +641,9 @@ -> state -> transaction state +val show_sql_query : freeTables ::: {{Type}} -> freeAggs ::: {{Type}} -> tables ::: {{Type}} -> exps ::: {Type} + -> show (sql_query freeTables freeAggs tables exps) + (*** Database mutators *) diff -r b8fa7441e637 -r b8558b613abd src/monoize.sml --- a/src/monoize.sml Sat Aug 18 13:57:48 2012 -0400 +++ b/src/monoize.sml Wed Aug 22 08:46:32 2012 -0400 @@ -1257,6 +1257,12 @@ in ((L'.EAbs ("s", s, s, (L'.ERel 0, loc)), loc), fm) end + | L.ECApp ((L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "show_sql_query"), _), _), _), _), _), _), _), _) => + let + val s = (L'.TFfi ("Basis", "string"), loc) + in + ((L'.EAbs ("s", s, s, (L'.ERel 0, loc)), loc), fm) + end | L.ECApp ((L.EFfi ("Basis", "mkShow"), _), t) => let val t = monoType env t diff -r b8fa7441e637 -r b8558b613abd tests/showSql.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/showSql.ur Wed Aug 22 08:46:32 2012 -0400 @@ -0,0 +1,5 @@ +table t : { A : int } + +fun main () : transaction page = return + {[(SELECT t.A FROM t ORDER BY t.A DESC) : sql_query [] [] _ _]} + diff -r b8fa7441e637 -r b8558b613abd tests/showSql.urp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/showSql.urp Wed Aug 22 08:46:32 2012 -0400 @@ -0,0 +1,3 @@ +database dbname=test + +showSql