Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/rxm.git

Clarified and shortened documentation.

AuthorDave Jarvis <email>
Date2015-03-28 13:34:18 GMT-0700
Commit8b1d0d5830332a6a97ac93abbf790a05a9e12b0a
Parent6643430
README.md
## Where
-Example **rxm** where conditions include:
+Example **rxm** expressions for SQL WHERE clauses include:
```
-account.id = $id # $ starts a named parameter
-account.id <> $id # inequality parameter comparison
-account.id = {$id, 1} # becomes IN set
-account.id <> {$id, 1} # becomes NOT IN set
+account.id = :id # : starts a named parameter
+account.id <> :id # inequality parameter comparison
+account.id = {:id, 1} # becomes IN set
+account.id <> {:id, 1} # becomes NOT IN set
account.id = null # becomes IS NULL
account.id <> null # becomes IS NOT NULL
account.id = 'text' # string equality comparison
account.id = -42 # numeric equality comparison
account.id < 42 # numeric less than comparison
account.id > 42 # numeric greater than comparison
account.id <= 42 # numeric less than or equal to comparison
account.id >= 42 # numeric greater than or equal to comparison
```
-
-The conditions generate corresponding SQL `WHERE` conditions as expected.
-
-### Variables
-
-Named parameters start with `$`.
-
-### Logical Operators
-The `&&` and `||` operators indicate logical **and** and **or** expressions,
-respectively.
+The `&&` and `||` operators indicate logical **and** and **or** expressions.
## Namespace
source/grammar/Query.g
T_EXPR_SET_CLOSE: '}' ;
-/* Define the WHER clause parameter token. */
-T_EXPR_PARAMETER: '$' ;
+/* Define the WHERE clause parameter token identifier prefix. */
+T_EXPR_PARAMETER: ':' ;
/************************************************************************
test/where.rxm
.id > @pk,
;
-((person.id = $id) ||
-(person.id <> $id) ||
-(person.id = {$id, 42}) ||
-(person.id <> {$id, 42}) ||
+((person.id = :id) ||
+(person.id <> :id) ||
+(person.id = {:id, 42}) ||
+(person.id <> {:id, 42}) ||
(person.id = null) ||
(person.id <> null) ||
Delta12 lines added, 21 lines removed, 9-line decrease