Skip to main content

CatalogCommand

Enum CatalogCommand 

Source
pub enum CatalogCommand {
Show 38 variants CreateTable { name: String, schema: Schema, created_epoch: u64, }, DropTable { name: String, at_epoch: u64, }, RenameTable { name: String, new_name: String, at_epoch: u64, }, AlterColumn { table: String, column: ColumnDef, }, AddColumn { table: String, column: ColumnDef, }, DropColumn { table: String, column: String, }, AddIndex { table: String, index: IndexDef, }, RemoveIndex { table: String, name: String, }, CreateUser { username: String, password_hash: String, is_admin: bool, created_epoch: u64, }, DropUser { username: String, }, AlterUserPassword { username: String, password_hash: String, }, SetUserAdmin { username: String, is_admin: bool, }, CreateRole { name: String, created_epoch: u64, }, DropRole { name: String, }, GrantRole { username: String, role: String, }, RevokeRole { username: String, role: String, }, GrantPermission { role: String, permission: Permission, }, RevokePermission { role: String, permission: Permission, }, EnableRls { table: String, }, DisableRls { table: String, }, SetRowPolicy { policy: RowPolicy, }, DropRowPolicy { table: String, name: String, }, SetColumnMask { mask: ColumnMask, }, DropColumnMask { table: String, name: String, }, SetSecurityCatalog { security: SecurityCatalog, }, CreateTrigger { trigger: StoredTrigger, }, DropTrigger { name: String, }, CreateProcedure { procedure: StoredProcedure, }, DropProcedure { name: String, }, CreateMaterializedView { definition: MaterializedViewEntry, }, DropMaterializedView { name: String, }, RefreshMaterializedView { name: String, at_epoch: u64, checkpoint_event_id: Option<String>, }, SetResourceGroup { group: ResourceGroupDef, }, RemoveResourceGroup { name: String, }, SubmitJob { job: JobDefinition, }, SetJobState { job_id: u64, state: JobState, at_epoch: u64, }, ReplaceTrigger { trigger: StoredTrigger, }, ReplaceProcedure { procedure: StoredProcedure, },
}
Expand description

One logical catalog mutation (spec §10.6, S1F-001).

Variants carry already-validated payloads (mirroring how DdlOp records carry resolved ColumnDef/schema JSON): deep semantic validation (expression trees, SQL typing) happens at the emitting layer, while apply enforces the catalog-level structural invariants fail-closed (existence, uniqueness, id allocation, reference integrity).

Variants§

§

CreateTable

Create a live table. table_id is allocated deterministically from next_table_id at apply time and stamped as schema.schema_id.

Fields

§name: String
§schema: Schema
§created_epoch: u64
§

DropTable

Logically drop a live table. Cascades to triggers targeting the table, the same-named materialized-view definition, RLS state, policies, masks, and table-scoped role permissions (mirrors Database::drop_table).

Fields

§name: String
§at_epoch: u64
§

RenameTable

Rename a live table. Retargets triggers and renames the same-named materialized-view definition. name == new_name is a recorded no-op (mirrors Database::rename_table).

Fields

§name: String
§new_name: String
§at_epoch: u64
§

AlterColumn

Replace one existing column definition (same id) with an already-validated one. Mirrors DdlOp::AlterTable.

Fields

§table: String
§column: ColumnDef
§

AddColumn

Add a column with a caller-allocated, unused id.

Fields

§table: String
§column: ColumnDef
§

DropColumn

Drop a column by name; indexes referencing it are dropped too (mirrors the SQL ALTER TABLE ... DROP COLUMN rebuild path).

Fields

§table: String
§column: String
§

AddIndex

Add a secondary index definition to a live table.

Fields

§table: String
§index: IndexDef
§

RemoveIndex

Remove one index by exact name. Compound SQL index names expand to one command per IndexDef at the emitting layer.

Fields

§table: String
§name: String
§

CreateUser

Create a user. id is allocated deterministically from next_user_id (minimum 1) at apply time.

Fields

§username: String
§password_hash: String
§is_admin: bool
§created_epoch: u64
§

DropUser

Fields

§username: String
§

AlterUserPassword

Fields

§username: String
§password_hash: String
§

SetUserAdmin

Fields

§username: String
§is_admin: bool
§

CreateRole

Fields

§name: String
§created_epoch: u64
§

DropRole

Drop a role and strip it from every user (mirrors Database::drop_role).

Fields

§name: String
§

GrantRole

Grant a role to a user. Idempotent: granting an already-held role is a recorded no-op (mirrors Database::grant_role).

Fields

§username: String
§role: String
§

RevokeRole

Revoke a role from a user. Idempotent no-op when not held.

Fields

§username: String
§role: String
§

GrantPermission

Grant a permission to a role, merging column lists for column-scoped grants. Idempotent no-op when the merged set is unchanged.

Fields

§role: String
§permission: Permission
§

RevokePermission

Revoke a permission from a role. Idempotent no-op when unchanged.

Fields

§role: String
§permission: Permission
§

EnableRls

Fields

§table: String
§

DisableRls

Fields

§table: String
§

SetRowPolicy

Create or replace a row policy keyed by (table, name).

Fields

§policy: RowPolicy
§

DropRowPolicy

Fields

§table: String
§name: String
§

SetColumnMask

Create or replace a column mask keyed by (table, name).

Fields

§

DropColumnMask

Fields

§table: String
§name: String
§

SetSecurityCatalog

Wholesale security-catalog replacement (RLS tables, policies, masks), mirroring Database::set_security_catalog. Validated against the candidate catalog exactly like the legacy path.

Fields

§

CreateTrigger

Fields

§

DropTrigger

Fields

§name: String
§

CreateProcedure

Fields

§

DropProcedure

Fields

§name: String
§

CreateMaterializedView

Create or replace a materialized-view definition. The backing live table must already exist (mirrors Database::set_materialized_view).

Fields

§

DropMaterializedView

Drop only the definition; the physical table is dropped separately via CatalogCommand::DropTable (which also cascades definitions).

Fields

§name: String
§

RefreshMaterializedView

Record refresh bookkeeping: bump last_refresh_epoch and, for incremental views, advance the CDC checkpoint when provided.

Fields

§name: String
§at_epoch: u64
§checkpoint_event_id: Option<String>
§

SetResourceGroup

Create or replace a resource group.

Fields

§

RemoveResourceGroup

Fields

§name: String
§

SubmitJob

Submit a new persistent job. job_id must be unused.

Fields

§

SetJobState

Record a job state change. Transitions out of terminal states (Succeeded/Failed) fail closed; S1F-002 owns the full machine.

Fields

§job_id: u64
§state: JobState
§at_epoch: u64
§

ReplaceTrigger

Create or replace a trigger, keyed by name. trigger is the resolved image: the emitter stamps created_epoch/updated_epoch/version from the commit epoch (and bumps version on replacement) before proposing, so replay is verbatim (mirrors Database::create_or_replace_trigger).

Fields

§

ReplaceProcedure

Create or replace a stored procedure, keyed by name; the payload is the epoch-resolved image (mirrors Database::create_or_replace_procedure).

Fields

Trait Implementations§

Source§

impl Clone for CatalogCommand

Source§

fn clone(&self) -> CatalogCommand

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 CatalogCommand

Source§

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

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

impl<'de> Deserialize<'de> for CatalogCommand

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CatalogCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.