summaryrefslogtreecommitdiff
path: root/src/urweb.grm
diff options
context:
space:
mode:
authorGravatar Karn Kallio <kkallio@eka>2011-11-23 12:17:40 -0530
committerGravatar Karn Kallio <kkallio@eka>2011-11-23 12:17:40 -0530
commit4f189ee576e925733c1ffc6c483cb95cf0711170 (patch)
tree50be5eee01b33287ce0f9d137f9fd2dded507ed6 /src/urweb.grm
parente9dcc580d0cb1222ef3889e6f536953724857c3d (diff)
Add LIKE operator to SQL sublanguage.
Diffstat (limited to 'src/urweb.grm')
-rw-r--r--src/urweb.grm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 8e3fad90..bb9ea18b 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -244,7 +244,7 @@ fun tnamesOf (e, _) =
| TRUE | FALSE | CAND | OR | NOT
| COUNT | AVG | SUM | MIN | MAX
| ASC | DESC
- | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS | COALESCE
+ | INSERT | INTO | VALUES | UPDATE | SET | DELETE | NULL | IS | COALESCE | LIKE
| CURRENT_TIMESTAMP
| NE | LT | LE | GT | GE
| CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES
@@ -1834,6 +1834,8 @@ sqlexp : TRUE (sql_inject (EVar (["Basis"], "True", In
| sqlexp CAND sqlexp (sql_binary ("and", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
| sqlexp OR sqlexp (sql_binary ("or", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
+ | sqlexp LIKE sqlexp (sql_binary ("like", sqlexp1, sqlexp2, s (sqlexp1left, sqlexp2right)))
+
| NOT sqlexp (sql_unary ("not", sqlexp, s (NOTleft, sqlexpright)))
| MINUS sqlexp (sql_unary ("neg", sqlexp, s (MINUSleft, sqlexpright)))