pub enum Token {
Show 88 variants
Select,
From,
Where,
As,
Null,
True,
False,
And,
Or,
Not,
Create,
Table,
Insert,
Into,
Values,
Index,
On,
Begin,
Commit,
Rollback,
Order,
By,
Limit,
Ident(String),
QuotedIdent(String),
Integer(i64),
Float(f64),
String(String),
Plus,
Minus,
Star,
Slash,
Eq,
NotEq,
Lt,
LtEq,
Gt,
GtEq,
LParen,
RParen,
LBracket,
RBracket,
Comma,
Semicolon,
Dot,
JsonGet,
JsonGetText,
JsonGetPath,
JsonGetPathText,
JsonContains,
L2Distance,
InnerProduct,
CosineDistance,
DoubleColon,
Concat,
Is,
Between,
In,
Like,
Group,
Distinct,
Union,
All,
Join,
Inner,
Left,
Cross,
Outer,
Default,
Savepoint,
Release,
To,
Having,
Show,
Extract,
Offset,
Asc,
Desc,
Interval,
Placeholder(u16),
Drop,
For,
Tables,
Except,
Publication,
Subscription,
Connection,
Eof,
}Variants§
Select
From
Where
As
Null
True
False
And
Or
Not
Create
Table
Insert
Into
Values
Index
On
Begin
Commit
Rollback
Order
By
Limit
Ident(String)
QuotedIdent(String)
Integer(i64)
Float(f64)
String(String)
Plus
Minus
Star
Slash
Eq
NotEq
Lt
LtEq
Gt
GtEq
LParen
RParen
LBracket
RBracket
Comma
Semicolon
Dot
JsonGet
pgvector L2 distance operator <->. Lexed as one token so the
parser can give it its own precedence rung.
v4.14 -> — JSON object/array element access, returns json.
JsonGetText
v4.14 ->> — same access, returns text.
JsonGetPath
v6.4.5 #> — JSON path walk, returns json. Path is the
right-hand TEXT with PG {a,b,0} syntax.
JsonGetPathText
v6.4.5 #>> — same walk, returns text.
JsonContains
v6.4.5 @> — JSON containment. j @> sub returns true if
every key/value in sub is present in j with structural
containment for objects + arrays.
L2Distance
InnerProduct
pgvector inner-product operator <#> (returns negative dot product
so smaller still means more similar — same semantics as pgvector).
CosineDistance
pgvector cosine distance operator <=>.
DoubleColon
PG-style cast expr::type — single token because we want it to bind
at postfix precedence.
Concat
Standard SQL string concatenation ||.
Is
IS keyword — postfix IS NULL / IS NOT NULL predicates.
Between
In
Like
Group
Distinct
Union
All
Join
Inner
Left
Cross
Outer
Default
Savepoint
Release
To
Having
Show
Extract
Offset
Asc
Desc
Interval
INTERVAL — followed by a string literal carrying the span text
(e.g. INTERVAL '1 day 2 hours').
Placeholder(u16)
v6.1.1 — $N parameter placeholder for the extended query
protocol. The number N is 1-based per PostgreSQL convention.
0 and $0 are not valid; the lexer rejects them.
Drop
v6.1.2 — DROP keyword. Used by DROP PUBLICATION <name>.
Reserved for future DROP TABLE / DROP INDEX / DROP USER
surface that currently goes through SHOW-shaped admin SQL.
For
v6.1.2 — FOR keyword (publication scope).
Tables
v6.1.2 — TABLES plural keyword (FOR ALL TABLES,
FOR ALL TABLES EXCEPT …). The existing TABLE keyword
stays a separate token so CREATE TABLE’s single-table
form keeps lexing as today.
Except
v6.1.3 (reserved at v6.1.2 to keep the AST shape stable) —
EXCEPT keyword for FOR ALL TABLES EXCEPT t1, t2.
Publication
v6.1.2 — PUBLICATION keyword.
Subscription
v6.1.4 (reserved at v6.1.2) — SUBSCRIPTION keyword.
Connection
v6.1.4 — CONNECTION keyword (for
CREATE SUBSCRIPTION … CONNECTION '<conn_str>' …).