pub struct FieldDefinition {
pub name: String,
pub field_type: String,
pub is_primary: bool,
pub index_config: IndexConfig,
pub relationship: Option<RelationshipDefinition>,
pub assign_created_time: bool,
pub assign_updated_time: bool,
pub expires_at: bool,
pub computed_from: Option<String>,
pub default_value: Option<Value>,
}Expand description
Field definition within a table.
Fields§
§name: StringField name (attribute name)
field_type: StringGraphQL type (ID, String, Int, Boolean, etc.)
is_primary: boolWhether this field is the primary key
index_config: IndexConfigIndex configuration for this field
relationship: Option<RelationshipDefinition>Optional relationship configuration for foreign keys
assign_created_time: boolAuto-assign creation timestamp (@createdTime)
assign_updated_time: boolAuto-assign update timestamp (@updatedTime)
expires_at: boolTTL expiration field (@expiresAt)
computed_from: Option<String>Computed field expression from @computed(from: "expr")
default_value: Option<Value>Default value from @default(value: ...) — type-validated at parse time
Trait Implementations§
Source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
Source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldDefinition
impl Debug for FieldDefinition
Auto Trait Implementations§
impl Freeze for FieldDefinition
impl RefUnwindSafe for FieldDefinition
impl Send for FieldDefinition
impl Sync for FieldDefinition
impl Unpin for FieldDefinition
impl UnsafeUnpin for FieldDefinition
impl UnwindSafe for FieldDefinition
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
Mutably borrows from an owned value. Read more