Lexical elements
Fauna Query Language (FQL) supports UTF-8 encoded Unicode text.
This section covers the basic character set, whitespace, line termination, and comments syntax elements.
Character set
FQL supports the following character set:
a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9
$ ! % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ { | } ~ `
Schema entity naming might impose added restrictions on the allowed character set.
Whitespace
Whitespace may be used between FQL tokens and are ignored by the parse. Whitespace is a nonempty sequence of any of the following characters, as listed in the ECMAScript Language Specification:
Unicode code point | Description | Escape sequence |
---|---|---|
|
Character tab |
|
|
Line tab |
|
|
Form feed |
|
|
Space |
|
|
No-break space |
|
|
Zero-width no-break space |
Line termination and block-style comments are also treated as whitespace and can be used anywhere whitespace can be used.
Line terminators
Line terminators can be used where permitted by the syntactic grammar, which is wherever whitespace is allowed.
The following table lists the recognized line termination characters:
Unicode code point | Description | Escape sequence |
---|---|---|
|
Line feed |
|
|
Carriage return |
|
|
Line separator |
|
|
Paragraph separator |
Escaped characters
Use a backslash (\
) to escape a character in a String:
Escape sequence | Escaped character |
---|---|
|
|
|
single quote |
|
double quote |
|
backtick |
|
number symbol |
|
backspace |
|
horizontal tab |
|
line feed, new line |
|
vertical tab |
|
form feed |
|
carriage return |
|
backslash |
|
character represented by the hexadecimal value |
|
character represented by the Unicode code point |
|
character represented by the arbitrary Unicode code point |
Comments
FQL supports single-line and block comments.
-
Single-line Comments
The
//
character sequence starts a single-line comment. A line feed terminates the comment. -
Block Comments
A block comment can be used where whitespace is permitted.
The
/*
character sequence starts a block comment. The comment is terminated by the matching*/
character sequence. A block comment can span multiple lines and block comments can be nested.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!