Skip to main content

Phase

Enum Phase 

Source
pub enum Phase {
Show 52 variants Start, SelectProjection, InProjection, NextProjection, AfterStar, ProjectionAlias, ExpectTable, AfterTable, JoinModifier, JoinComplete, OnClause, UsingClause, WhereClause, InPredicate, AfterGroup, GroupByList, AfterOrder, OrderByList, HavingClause, LimitClause, OffsetClause, AfterInsert, AfterInsertTable, InsertColumnList, InsertExpectValues, InsertValuesList, AfterUpdate, AfterUpdateTable, UpdateAssignment, AfterDelete, ReturningClause, AfterCreate, AfterAlter, AfterDrop, AfterAlterTableExpectName, AfterAlterTableName, AfterGrantOrRevoke, AfterGrantOn, AfterGrantTo, PlpgsqlBody, PlpgsqlAssignRhs, CtlExpectTableName, CtlBodyStart, CtlExpectType, CtlExpectColumnConstraint, CtlExpectConstraintName, CtlExpectConstraintKind, CtlExpectFkTable {}, CtlExpectFkColumn { table: String, }, CtlCheckExpr { table: Option<String>, }, CastType, Unknown,
}

Variants§

§

Start

Empty buffer or right after a ;. Top-level statement keywords.

§

SelectProjection

After SELECT. Expect projection items (columns / * / funcs / DISTINCT / ALL).

§

InProjection

Mid-projection identifier (after a column name). Expect AS, comma to add another column, or FROM.

§

NextProjection

Right after a comma in the projection list. Expect another column.

§

AfterStar

Right after * (whole row). Expect FROM or a comma to mix in more projections like SELECT *, foo FROM ....

§

ProjectionAlias

Right after AS inside the projection list. Expect alias name.

§

ExpectTable

After FROM / a comma inside FROM list / JOIN. Expect a table.

§

AfterTable

After a table name (possibly aliased). Expect comma / JOIN family / WHERE / GROUP BY / HAVING / ORDER BY / LIMIT / OFFSET / ;.

§

JoinModifier

After INNER / LEFT / RIGHT / FULL / CROSS. Expect JOIN or OUTER.

§

JoinComplete

After a join completed but before ON / USING.

§

OnClause

After ON. Expect a predicate.

§

UsingClause

After USING. Expect (.

§

WhereClause

After WHERE. Expect a predicate.

§

InPredicate

Mid-predicate. Expect AND / OR / ORDER BY / GROUP BY / …

§

AfterGroup

After GROUP (expect BY).

§

GroupByList

After GROUP BY. Expect columns / numbers / GROUPING SETS / ROLLUP.

§

AfterOrder

After ORDER (expect BY).

§

OrderByList

After ORDER BY. Expect column [ASC|DESC] [NULLS FIRST|LAST].

§

HavingClause

After HAVING. Expect a predicate over aggregates.

§

LimitClause

After LIMIT. Expect a number.

§

OffsetClause

After OFFSET. Expect a number.

§

AfterInsert

§

AfterInsertTable

§

InsertColumnList

§

InsertExpectValues

§

InsertValuesList

§

AfterUpdate

§

AfterUpdateTable

§

UpdateAssignment

§

AfterDelete

§

ReturningClause

After RETURNING in INSERT / UPDATE / DELETE. Expect columns of the target table (the one named in INTO / UPDATE / DELETE FROM), plus *. Acts like a SELECT projection scoped to that one table.

§

AfterCreate

§

AfterAlter

§

AfterDrop

§

AfterAlterTableExpectName

After ALTER TABLE [IF EXISTS] [ONLY] – expect a table name. Engine surfaces tables here.

§

AfterAlterTableName

After ALTER TABLE <name> – expect a sub-action keyword (ADD COLUMN, DROP COLUMN, RENAME, ALTER COLUMN, …). Engine emits the curated snippet list.

§

AfterGrantOrRevoke

After GRANT / REVOKE – expect a privilege keyword (SELECT / INSERT / UPDATE / DELETE / TRUNCATE / REFERENCES / TRIGGER / USAGE / EXECUTE / CREATE / CONNECT / TEMPORARY) or ALL [PRIVILEGES]. Engine emits the curated keyword set.

§

AfterGrantOn

After GRANT/REVOKE ... ON [TABLE|SEQUENCE|FUNCTION|SCHEMA|...] – expect a target name. Engine emits tables/sequences/funcs.

§

AfterGrantTo

After GRANT ... TO or REVOKE ... FROM – expect a role from the catalog, plus the PUBLIC pseudo-role.

§

PlpgsqlBody

Cursor sits inside a $$ ... $$ body (DO block or function body). PL/pgSQL keywords + functions + columns make sense here.

§

PlpgsqlAssignRhs

Right-hand side of a PL/pgSQL assignment (v_x := ... or NEW.col := ...). Statement-level keywords like SELECT / CREATE are invalid here – only expressions are.

§

CtlExpectTableName

After CREATE TABLE [IF NOT EXISTS] – expect a fresh table name. No completion offered (user invents the name).

§

CtlBodyStart

Start of an entry inside CREATE TABLE body (after ( or ,). User could either type a column name or a constraint-line keyword (CONSTRAINT / PRIMARY KEY / FOREIGN KEY / UNIQUE / CHECK).

§

CtlExpectType

After a column name – expect a type.

§

CtlExpectColumnConstraint

After a column type – expect column constraint keywords (NOT NULL, DEFAULT, PRIMARY KEY, REFERENCES, UNIQUE, CHECK, …).

§

CtlExpectConstraintName

After CONSTRAINT – expect a fresh constraint name. No completion.

§

CtlExpectConstraintKind

After CONSTRAINT <name> – expect a kind keyword (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK).

§

CtlExpectFkTable

After REFERENCES – expect a target table.

§

CtlExpectFkColumn

After REFERENCES tbl ( – expect a column of that table.

Fields

§table: String
§

CtlCheckExpr

Inside a CHECK ( ... ) expression. Expect this table’s columns plus the full PG function library and expression keywords – CHECK bodies are arbitrary boolean expressions.

Fields

§

CastType

Right after the PG :: cast operator. Expect a type (DATE, NUMERIC, TEXT, JSONB, custom enum/domain, …).

§

Unknown

Anything we couldn’t classify – the engine falls back to a broad emitter so the menu is never empty.

Trait Implementations§

Source§

impl Clone for Phase

Source§

fn clone(&self) -> Self

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 Phase

Source§

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

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

impl Eq for Phase

Source§

impl PartialEq for Phase

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Phase

Auto Trait Implementations§

§

impl Forget for Phase

§

impl Freeze for Phase

§

impl Move for Phase

§

impl RefUnwindSafe for Phase

§

impl Send for Phase

§

impl Sync for Phase

§

impl Unpin for Phase

§

impl UnsafeUnpin for Phase

§

impl UnwindSafe for Phase

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.