pub enum SchemaOperation {
CreateEntity {
name: String,
fields: Vec<FieldSpec>,
},
AddField {
entity: String,
field: FieldSpec,
},
RemoveField {
entity: String,
field_name: String,
},
AlterField {
entity: String,
previous: FieldSpec,
target: FieldSpec,
},
RemoveEntity {
name: String,
},
AddIndex {
entity: String,
name: String,
fields: Vec<String>,
unique: bool,
},
RemoveIndex {
entity: String,
name: String,
},
CreateSearchIndex {
entity: String,
config: ManifestSearchConfig,
},
RemoveSearchIndex {
entity: String,
},
Noop,
}Variants§
CreateEntity
AddField
RemoveField
AlterField
Change column shape on an existing field. Only nullable transitions
today (required → optional, optional → required); type changes
stay manual because they can fail on existing rows in ways the
planner can’t reason about (e.g. string → int on a column with
non-numeric values).
Real-world driver: pylon-cloud’s User entity made avatarColor
optional after the framework’s OAuth handler started failing
USER_CREATE_FAILED on a NOT NULL violation. Without AlterField
the manifest change was a no-op against the live PG schema
— operators had to drop NOT NULL by hand. Now the planner emits
the ALTER and pylon dev auto-applies it on the next reload.
previous carries the old column shape so the SQL emitter can
decide whether to emit DROP NOT NULL, SET NOT NULL, both, or
neither. target is the desired final shape.
RemoveEntity
AddIndex
RemoveIndex
CreateSearchIndex
Materialize the FTS5 + facet-bitmap shadow tables for a
searchable entity. Emitted alongside CreateEntity when the
manifest declares a search: config; idempotent so repeated
pushes against a live DB are safe.
RemoveSearchIndex
Drop an entity’s search shadow tables. Emitted when the entity
is removed from the manifest or its search: block is cleared.
Noop
Trait Implementations§
Source§impl Clone for SchemaOperation
impl Clone for SchemaOperation
Source§fn clone(&self) -> SchemaOperation
fn clone(&self) -> SchemaOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaOperation
impl Debug for SchemaOperation
Source§impl<'de> Deserialize<'de> for SchemaOperation
impl<'de> Deserialize<'de> for SchemaOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SchemaOperation
impl PartialEq for SchemaOperation
Source§fn eq(&self, other: &SchemaOperation) -> bool
fn eq(&self, other: &SchemaOperation) -> bool
self and other values to be equal, and is used by ==.