Syntax

Identifiers

An identifier is a name matching [a-zA-Z_][a-zA-Z0-9_]* that is not a reserved word. Identifiers are case-sensitive. Keywords must be written in lowercase. Quoted identifiers are not supported.

points          -- valid
myTable         -- valid
select          -- reserved; cannot be used as a bare identifier

Literals

42              -- integer
3.14            -- float
-1              -- negative number
'hello'         -- single-quoted string
"hello"         -- double-quoted string
'it''s fine'    -- embedded single quote
"say ""hi"""    -- embedded double quote
'\n'            -- two-character string, not a newline
true            -- boolean
false           -- boolean
null            -- null
{ x: 1, y: 2 }  -- object
{ ...t, z: 3 }  -- object with spread
[1, 2, 3]       -- array
[1, 2, ]        -- array with trailing comma

Comments

Single-line comments begin with -- and run to end of line. Block comments are not supported.

select x from t;   -- this is a comment

Reserved Words

The following words are reserved and may not appear as bare identifiers:

KeywordRole
andLogical conjunction
asSource alias in from
ascAscending sort order
betweenRange predicate
byorder by clause
clearclear statement
createcreate table statement
deletedelete statement
descDescending sort order
dropdrop table statement
falseBoolean literal
fromfrom clause
inMembership predicate
insertinsert statement
intoinsert into target
intInteger key-column type
isNull and truth tests
limitlimit clause
notLogical negation
nullNull literal
orLogical disjunction
orderorder by clause
selectselect clause
stringString key-column type
tablecreate table / drop table
trueBoolean literal
unknownis unknown test
wherewhere clause