[−][src]Trait butane_core::DataObject
An object in the database.
Rather than implementing this type manually, use the
#[model]
attribute.
Associated Types
Loading content...Associated Constants
pub const PKCOL: &'static str
[src]
The name of the primary key column.
pub const TABLE: &'static str
[src]
The name of the table.
Required methods
pub fn pk(&self) -> &Self::PKType
[src]
Get the primary key
pub fn save(&mut self, conn: &impl ConnectionMethods) -> Result<()>
[src]
Save the object to the database.
pub fn delete(&self, conn: &impl ConnectionMethods) -> Result<()>
[src]
Delete the object from the database.
Provided methods
pub fn get(
conn: &impl ConnectionMethods,
id: impl Borrow<Self::PKType>
) -> Result<Self> where
Self: Sized,
[src]
conn: &impl ConnectionMethods,
id: impl Borrow<Self::PKType>
) -> Result<Self> where
Self: Sized,
Find this object in the database based on primary key.