Skip to main content

Statement

Enum Statement 

Source
pub enum Statement {
Show 31 variants Select(SelectStatement), CreateTable(CreateTableStatement), CreateExtension(String), DoBlock, CreateIndex(CreateIndexStatement), Insert(InsertStatement), Update(UpdateStatement), Delete(DeleteStatement), Begin, Commit, Rollback, Savepoint(String), RollbackToSavepoint(String), ReleaseSavepoint(String), ShowTables, ShowColumns(String), CreateUser(CreateUserStatement), DropUser(String), ShowUsers, Explain(ExplainStatement), AlterIndex(AlterIndexStatement), AlterTable(AlterTableStatement), CreatePublication(CreatePublicationStatement), DropPublication(String), ShowPublications, CreateSubscription(CreateSubscriptionStatement), DropSubscription(String), ShowSubscriptions, WaitForWalPosition { pos: u64, timeout_ms: Option<u64>, }, Analyze(Option<String>), CompactColdSegments,
}

Variants§

§

Select(SelectStatement)

§

CreateTable(CreateTableStatement)

§

CreateExtension(String)

v7.9.15 — CREATE EXTENSION [IF NOT EXISTS] <name> [WITH SCHEMA <s>] [VERSION <v>] [CASCADE] accepted as a no-op so PG dumps that include extension declarations (notably pgvector) load against SPG without splitting init scripts. mailrs migration follow-up F3.

§

DoBlock

v7.9.27 — PG DO $$ … $$ [LANGUAGE plpgsql]; block. SPG has no PL/pgSQL; engine returns CommandOk no-op so pg_dump output with idempotent DO migrations loads against SPG without splitting scripts. The lexer consumes the dollar-quoted body into a discarded Token::String. mailrs migration follow-up H1.

§

CreateIndex(CreateIndexStatement)

§

Insert(InsertStatement)

§

Update(UpdateStatement)

v4.4 — UPDATE <table> SET col=expr [, ...] [WHERE cond].

§

Delete(DeleteStatement)

v4.4 — DELETE FROM <table> [WHERE cond].

§

Begin

§

Commit

§

Rollback

§

Savepoint(String)

SAVEPOINT <name> — push a named savepoint onto the active TX’s stack so a later ROLLBACK TO <name> can undo just the work since this point.

§

RollbackToSavepoint(String)

ROLLBACK TO [SAVEPOINT] <name> — restore catalog state to the named savepoint and discard later savepoints. Does not end the transaction.

§

ReleaseSavepoint(String)

RELEASE [SAVEPOINT] <name> — discard a savepoint without rolling back. Keeps the work done since then.

§

ShowTables

SHOW TABLES — return the list of tables in the catalog.

§

ShowColumns(String)

SHOW COLUMNS FROM <table> — return one row per column with its declared name / type / nullability.

§

CreateUser(CreateUserStatement)

CREATE USER 'name' WITH PASSWORD 'pw' ROLE 'admin' (v4.1). Role is optional; defaults to readonly when omitted.

§

DropUser(String)

DROP USER 'name' (v4.1).

§

ShowUsers

SHOW USERS (v4.1) — admin-only listing of (name, role).

§

Explain(ExplainStatement)

v4.26 — EXPLAIN [ANALYZE] <select>. The engine returns a single-column text table describing the rewritten plan tree for inner. analyze triggers an actual exec to attach observed row counts and elapsed micros to each node.

§

AlterIndex(AlterIndexStatement)

v6.0.4 — ALTER INDEX <name> REBUILD [WITH (encoding = ...)]. Synchronous rebuild of an NSW index. With the optional encoding clause, every stored cell at the indexed column is also re-encoded through coerce_value before the new graph builds.

§

AlterTable(AlterTableStatement)

v6.7.2 — ALTER TABLE <name> SET <setting> = <value>. The only setting in v6.7.2 is hot_tier_bytes, which overrides the global SPG_HOT_TIER_BYTES freezer trigger for the named table.

§

CreatePublication(CreatePublicationStatement)

v6.1.2 — CREATE PUBLICATION <name> [FOR ALL TABLES]. The catalog row lives in spg_publications. Publisher-side WAL filtering arrives in v6.1.5.

§

DropPublication(String)

v6.1.2 — DROP PUBLICATION <name>. PG-compatible silent no-op when the publication does not exist.

§

ShowPublications

v6.1.3 — SHOW PUBLICATIONS. Returns one row per publication ordered by name with (name, scope_summary, table_count) columns. The scope summary is the human- readable form ALL TABLES / FOR TABLE … / FOR ALL TABLES EXCEPT …; table_count is NULL for the AllTables scope and the table-list length otherwise.

§

CreateSubscription(CreateSubscriptionStatement)

v6.1.4 — CREATE SUBSCRIPTION <name> CONNECTION '<conn>' PUBLICATION <pub_name> [, <pub_name> …]. Catalog lands in spg_subscriptions; when the subscription is enabled = true (default) the server spawns a background worker that connects to conn and drains the requested publication(s) into the local engine.

§

DropSubscription(String)

v6.1.4 — DROP SUBSCRIPTION <name>. Like DROP PUBLICATION, silent no-op when absent. Stops the associated worker thread before removing the row.

§

ShowSubscriptions

v6.1.4 — SHOW SUBSCRIPTIONS. Returns one row per subscription ordered by name with (name, conn_str, publications, enabled, last_received_pos).

§

WaitForWalPosition

v6.1.7 — WAIT FOR WAL POSITION <pos> [WITH TIMEOUT <ms>]. Blocks until the local server’s apply position reaches <pos> or <ms> elapses. Server-layer command: the engine refuses it (EngineError::Unsupported) since lag_state lives in spg-server’s ServerState.

Fields

§pos: u64
§timeout_ms: Option<u64>

None → wait forever; Some(ms) → return after ms milliseconds even if the target isn’t reached.

§

Analyze(Option<String>)

v6.2.0 — ANALYZE [<table>]. Bare form walks every user table; ANALYZE <name> re-stats just one. Populates spg_statistic with per-column null_frac + n_distinct + 100-bucket equi-depth histogram.

§

CompactColdSegments

v6.7.3 — COMPACT COLD SEGMENTS. Walks every user table’s BTree-cold indices and merges small cold-tier segments (size below SPG_COMPACTION_TARGET_SEGMENT_BYTES, default 4 MiB) into a single larger segment per (table, index). WHERE predicate filtering on which tables to compact is carved out of v6.7.3 (per V6_7_DESIGN.md STABILITY entry); v6.7.3 only supports the bare form.

Trait Implementations§

Source§

impl Clone for Statement

Source§

fn clone(&self) -> Statement

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 Statement

Source§

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

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

impl Display for Statement

Source§

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

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

impl PartialEq for Statement

Source§

fn eq(&self, other: &Statement) -> 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 Statement

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.