Reserved Words
- reference
SQL++ defines an extensive list of keywords that are reserved words. You cannot use these keywords as identifiers unless you escape them. All of the SQL++ keywords are case insensitive.
Some of the keywords are not currently implemented but are reserved for future use.
Using Reserved Words as Identifiers
SQL++ allows escaped identifiers to overlap with keywords.
To use a reserved word as an identifier, you must escape it by enclosing the reserved word inside backticks (``).
For example, if your JSON document contains a field named index
, you can use it in your queries by escaping it like this:
{
"age": "42",
"index": 27,
"name": "Elvis"
}
CREATE INDEX myindex ON default(`index`) USING GSI;
SQL++ Reserved Words
The following keywords are reserved and cannot be used as unescaped identifiers:
_INDEX_CONDITION |
_INDEX_KEY |
ALTER |
ANALYZE |
||
ASC |
AT |
||||
BEGIN |
BETWEEN |
BREAK |
BUCKET |
||
BUILD |
BY |
CACHE |
CALL |
CASE |
CAST |
CLUSTER |
COLLATE |
COLLECTION |
COMMIT |
CONNECT |
|
CONTINUE |
CORRELATED |
COVER |
CYCLE |
||
DATABASE |
DATASET |
DATASTORE |
DECLARE |
DECREMENT |
DEFAULT |
DERIVED |
DESC |
DESCRIBE |
DO |
||
EACH |
ELEMENT |
ELSE |
END |
ESCAPE |
|
EXCLUDE |
EXECUTE |
||||
FALSE |
FETCH |
FILTER |
FIRST |
FLATTEN |
FLATTEN_KEYS |
FLUSH |
FOR |
FORCE |
|||
GOLANG |
GRANT |
||||
HAVING |
IF |
IGNORE |
ILIKE |
||
INCLUDE |
INCREMENT |
INDEX |
INFER |
INLINE |
INNER |
INTO |
IS |
||||
KEY |
KEYS |
KEYSPACE |
KNOWN |
||
LAST |
LATERAL |
LEFT |
LETTING |
||
LIKE |
LSM |
MAP |
MAPPING |
MATCHED |
|
MATERIALIZED |
MAXVALUE |
MINVALUE |
NAMESPACE |
||
NEXT |
NEXTVAL |
||||
NUMBER |
OBJECT |
||||
ON |
OPTION |
||||
OUTER |
PARSE |
PARTITION |
PASSWORD |
PATH |
|
POOL |
PREPARE |
PREV |
PREVIOUS |
PREVVAL |
|
PRIMARY |
PRIVATE |
PRIVILEGE |
PROCEDURE |
PUBLIC |
|
RAW |
READ |
REALM |
RECURSIVE |
REDUCE |
|
RENAME |
REPLACE |
RESTART |
RESTRICT |
RETURN |
|
RETURNING |
REVOKE |
RIGHT |
ROLE |
||
SATISFIES |
SCHEMA |
SCOPE |
|||
SELF |
SEQUENCE |
SET |
SHOW |
SOME |
START |
STATISTICS |
STRING |
SYSTEM |
THEN |
TO |
|
TRIGGER |
TRUE |
TRUNCATE |
|||
UNDER |
UNIQUE |
UNKNOWN |
UNSET |
||
USER |
USERS |
USING |
|||
VALIDATE |
VALUE |
VALUED |
VALUES |
VECTOR |
VIA |
VIEW |
WHEN |
WHILE |
WINDOW |
WITH |
|
XOR |