pub enum OperationSpec {
Show 19 variants
DefineSchema {
schema: SchemaInfo,
},
AddAttribute {
attribute: AttributeSchemaEntry,
},
RemoveAttribute {
attr_name: String,
},
AddEntity {
entity: EntitySchemaEntry,
},
RemoveEntity {
type_name: String,
},
AddRelation {
relation: RelationSchemaEntry,
},
RemoveRelation {
type_name: String,
},
AddOwnership {
owner_type: String,
attribute: OwnedAttributeEntry,
},
RemoveOwnership {
owner_type: String,
attr_name: String,
},
ModifyOwnership {
owner_type: String,
attr_name: String,
old_annotations: String,
new_annotations: String,
},
ModifyTypeAnnotations {
type_name: String,
old_doc: Option<String>,
new_doc: Option<String>,
old_meta: BTreeMap<String, String>,
new_meta: BTreeMap<String, String>,
},
ModifyRoleAnnotations {
relation_type: String,
role_name: String,
old_doc: Option<String>,
new_doc: Option<String>,
old_meta: BTreeMap<String, String>,
new_meta: BTreeMap<String, String>,
},
AddRole {
relation_type: String,
role: RoleEntry,
},
RemoveRole {
relation_type: String,
role_name: String,
},
AddRolePlayer {
relation_type: String,
role_name: String,
player_type_name: String,
},
RemoveRolePlayer {
relation_type: String,
role_name: String,
player_type_name: String,
},
RunTypeql {
forward: String,
reverse: Option<String>,
},
RenameAttribute {
old_name: String,
new_name: String,
value_type: String,
},
CopyAttribute {
owner: Option<String>,
source: Option<String>,
dest: Option<String>,
filter: Option<String>,
forward: Option<String>,
reverse: Option<String>,
},
}Expand description
Operation variants covering the frozen Python ops.* authoring surface.
Variants§
DefineSchema
Define the complete schema for a model-based initial migration.
Fields
schema: SchemaInfoComplete model schema.
AddAttribute
Add a standalone attribute type.
Fields
attribute: AttributeSchemaEntryAttribute schema payload.
RemoveAttribute
Remove a standalone attribute type.
AddEntity
Add an entity type.
Fields
entity: EntitySchemaEntryEntity schema payload.
RemoveEntity
Remove an entity type.
AddRelation
Add a relation type.
Fields
relation: RelationSchemaEntryRelation schema payload.
RemoveRelation
Remove a relation type.
AddOwnership
Add attribute ownership to an entity or relation.
Fields
attribute: OwnedAttributeEntryOwned attribute payload.
RemoveOwnership
Remove attribute ownership from an entity or relation.
Fields
ModifyOwnership
Modify ownership annotations.
Fields
ModifyTypeAnnotations
Modify @doc/@meta annotations on an entity, relation, or attribute
type (TypeDB 3.12+).
Fields
ModifyRoleAnnotations
Modify @doc/@meta annotations on a relation role (TypeDB 3.12+).
Fields
AddRole
Add a role to a relation.
RemoveRole
Remove a role from a relation.
AddRolePlayer
Add a player type to a role.
Fields
RemoveRolePlayer
Remove a player type from a role.
Fields
RunTypeql
Execute authored TypeQL without interpreting it in this sub-plan.
RenameAttribute
Rename an attribute type.
Fields
CopyAttribute
Copy an attribute from source to dest on every instance of the owner type.
This is a DML (write-typed) backfill operation — it inserts attribute values, not schema. The forward TypeQL is an insert-if-absent backfill; the reverse deletes the destination attribute.
Two wire forms exist. The lowered form carries only forward/reverse
TypeQL (what .py execution lowers to); the structured form carries
owner/source/dest(/filter) and lets the authoring core
synthesize the TypeQL via copy_attribute_typeql and render a
faithful ops.CopyAttribute(...) in the generated .py. Sidecars
written by the authoring core always carry the synthesized strings, so
the executor keeps running carried TypeQL.
Implementations§
Source§impl OperationSpec
impl OperationSpec
Sourcepub fn normalized(self) -> Result<OperationSpec>
pub fn normalized(self) -> Result<OperationSpec>
Return the operation with any structured copy_attribute filled in
with its synthesized executable TypeQL. Other variants pass through.
§Errors
crate::error::MigrationError::AuthoringInput when a
copy_attribute carries neither TypeQL nor the structured fields.
Trait Implementations§
Source§impl Clone for OperationSpec
impl Clone for OperationSpec
Source§fn clone(&self) -> OperationSpec
fn clone(&self) -> OperationSpec
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 OperationSpec
impl Debug for OperationSpec
Source§impl<'de> Deserialize<'de> for OperationSpec
impl<'de> Deserialize<'de> for OperationSpec
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 OperationSpec
impl PartialEq for OperationSpec
Source§impl Serialize for OperationSpec
impl Serialize for OperationSpec
impl StructuralPartialEq for OperationSpec
Auto Trait Implementations§
impl Freeze for OperationSpec
impl RefUnwindSafe for OperationSpec
impl Send for OperationSpec
impl Sync for OperationSpec
impl Unpin for OperationSpec
impl UnsafeUnpin for OperationSpec
impl UnwindSafe for OperationSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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