summaryrefslogtreecommitdiff
path: root/src/urweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 15:33:28 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 15:33:28 -0400
commitb1710b4191841176fa84a2d7e10cabcf1d048bb4 (patch)
treeb3af420e0116388b43fc38752a344cbd9ed04b32 /src/urweb.grm
parentd710cc7a5aa246763af96dfca57ec8a7a5a6fd37 (diff)
CURRENT_TIMESTAMP
Diffstat (limited to 'src/urweb.grm')
-rw-r--r--src/urweb.grm10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 4f470fa0..3f56cb94 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -154,6 +154,13 @@ fun sql_relop (oper, sqlexp1, sqlexp2, loc) =
(EApp (e, sqlexp2), loc)
end
+fun sql_nfunc (oper, loc) =
+ let
+ val e = (EVar (["Basis"], "sql_nfunc", Infer), loc)
+ in
+ (EApp (e, (EVar (["Basis"], "sql_" ^ oper, Infer), loc)), loc)
+ end
+
fun native_unop (oper, e1, loc) =
let
val e = (EVar (["Basis"], oper, Infer), loc)
@@ -206,6 +213,7 @@ fun tagIn bt =
| COUNT | AVG | SUM | MIN | MAX
| ASC | DESC
| INSERT | INTO | VALUES | UPDATE | SET | DELETE
+ | CURRENT_TIMESTAMP
| NE | LT | LE | GT | GE
%nonterm
@@ -1169,6 +1177,8 @@ sqlexp : TRUE (sql_inject (EVar (["Basis"], "True", In
s (FLOATleft, FLOATright)))
| STRING (sql_inject (EPrim (Prim.String STRING),
s (STRINGleft, STRINGright)))
+ | CURRENT_TIMESTAMP (sql_nfunc ("current_timestamp",
+ s (CURRENT_TIMESTAMPleft, CURRENT_TIMESTAMPright)))
| tident DOT fident (let
val loc = s (tidentleft, fidentright)