Skip to main content

Token

Enum Token 

Source
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>' …).

§

Eof

Trait Implementations§

Source§

impl Clone for Token

Source§

fn clone(&self) -> Token

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Token

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Token

Source§

fn eq(&self, other: &Token) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl Freeze for Token

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnsafeUnpin for Token

§

impl UnwindSafe for Token

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.