pub enum AlterOperation {
Show 15 variants
AddColumn(CreateColumnDef),
DropColumn(String),
RenameColumn {
from: String,
to: String,
},
AttachPartition {
child: String,
bound: String,
},
DetachPartition {
child: String,
},
EnableRowLevelSecurity,
DisableRowLevelSecurity,
EnableTenancy {
column: String,
},
DisableTenancy,
SetAppendOnly(bool),
SetVersioned(bool),
EnableEvents(SubscriptionDescriptor),
DisableEvents,
AddSubscription {
name: String,
descriptor: SubscriptionDescriptor,
},
DropSubscription {
name: String,
},
}Expand description
Single ALTER TABLE operation
Variants§
AddColumn(CreateColumnDef)
ADD COLUMN definition
DropColumn(String)
DROP COLUMN name
RenameColumn
RENAME COLUMN from TO to
AttachPartition
ATTACH PARTITION child FOR VALUES ... (Phase 2.2 PG parity).
Binds an existing child table to the parent partitioned table.
The bound string captures the raw bound expression so the
runtime can round-trip it back into red_config without a
dedicated per-kind AST.
Fields
DetachPartition
DETACH PARTITION child
EnableRowLevelSecurity
ENABLE ROW LEVEL SECURITY (Phase 2.5 PG parity).
Flips the table into RLS-enforced mode. Reads against the table
will be filtered by every matching CREATE POLICY (for the
current role) combined with AND.
DisableRowLevelSecurity
DISABLE ROW LEVEL SECURITY — disables enforcement; policies
remain defined but are ignored until re-enabled.
EnableTenancy
ENABLE TENANCY ON (col) (Phase 2.5.4 PG parity-ish).
Retrofit a tenant-scoped declaration onto an existing table —
registers the column, installs the auto __tenant_iso RLS
policy, and flips RLS on. Equivalent to re-running
CREATE TABLE ... TENANT BY (col) minus the schema creation.
DisableTenancy
DISABLE TENANCY — tears down the auto-policy and clears the
tenancy registration. User-defined policies on the table are
untouched; RLS stays enabled if any survive.
SetAppendOnly(bool)
SET APPEND_ONLY = true|false — flips the catalog flag.
Setting true rejects all future UPDATE/DELETE at parse-time
guard; setting false re-enables them. Existing rows are
untouched either way — this is a purely declarative switch.
SetVersioned(bool)
SET VERSIONED = true|false — opt the table into (or out of)
Git-for-Data. Enables merge / diff / AS OF semantics against
this collection. Works retroactively: previously-created
rows become part of the history accessible via AS OF as long
as their xmin is still pinned by an existing commit.
EnableEvents(SubscriptionDescriptor)
ENABLE EVENTS ... — install or re-enable table event subscription metadata.
DisableEvents
DISABLE EVENTS — mark all table event subscriptions disabled.
AddSubscription
ADD SUBSCRIPTION name TO queue [REDACT (...)] [WHERE ...] — add a named subscription.
DropSubscription
DROP SUBSCRIPTION name — remove a named subscription by name.
Trait Implementations§
Source§impl Clone for AlterOperation
impl Clone for AlterOperation
Source§fn clone(&self) -> AlterOperation
fn clone(&self) -> AlterOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AlterOperation
impl RefUnwindSafe for AlterOperation
impl Send for AlterOperation
impl Sync for AlterOperation
impl Unpin for AlterOperation
impl UnsafeUnpin for AlterOperation
impl UnwindSafe for AlterOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request