pub struct TableDefinition {
pub name: String,
pub columns: Vec<ColumnDefinition>,
pub indexes: Vec<IndexDefinition>,
pub soft_delete: bool,
pub owner_field: Option<String>,
pub auth_required: bool,
pub permission_area: Option<String>,
pub hooks: Option<TableHooks>,
}Fields§
§name: String§columns: Vec<ColumnDefinition>§indexes: Vec<IndexDefinition>§soft_delete: bool§owner_field: Option<String>Column name that stores the owner’s user ID for row-level security. When set, CRUD operations are scoped to the authenticated user’s records.
auth_required: boolWhen true, all CRUD operations on this table require authentication. Unauthenticated requests receive a 401 Unauthorized response.
permission_area: Option<String>Permission area that controls access to this table’s CRUD operations. When set, platform checks “{area}:view” for GET, “{area}:create” for POST, “{area}:edit” for PUT, “{area}:delete” for DELETE.
hooks: Option<TableHooks>CRUD lifecycle hooks — WASM handler names called before/after operations.
Implementations§
Source§impl TableDefinition
impl TableDefinition
Sourcepub fn primary_key(&self) -> Option<&ColumnDefinition>
pub fn primary_key(&self) -> Option<&ColumnDefinition>
Get the primary key column
Sourcepub fn writable_columns(&self) -> Vec<&ColumnDefinition>
pub fn writable_columns(&self) -> Vec<&ColumnDefinition>
Get all non-primary-key, non-auto columns (for INSERT/UPDATE)
Trait Implementations§
Source§impl Clone for TableDefinition
impl Clone for TableDefinition
Source§fn clone(&self) -> TableDefinition
fn clone(&self) -> TableDefinition
Returns a duplicate of the value. Read more
1.0.0 · 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 TableDefinition
impl Debug for TableDefinition
Source§impl<'de> Deserialize<'de> for TableDefinition
impl<'de> Deserialize<'de> for TableDefinition
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TableDefinition
impl RefUnwindSafe for TableDefinition
impl Send for TableDefinition
impl Sync for TableDefinition
impl Unpin for TableDefinition
impl UnsafeUnpin for TableDefinition
impl UnwindSafe for TableDefinition
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