Skip to main content

cortex/concerns/
orm.rs

1use diesel::pg::PgConnection;
2use diesel::result::Error;
3
4/// A minimalistic ORM trait for `CorTeX` data items
5pub trait CortexInsertable {
6  /// Creates a new item given a connection
7  fn create(&self, connection: &mut PgConnection) -> Result<usize, Error>;
8}
9
10/// A minimalistic ORM trait for `CorTeX` data items
11pub trait CortexDeletable {
12  /// Creates a new item given a connection
13  fn delete_by(&self, connection: &mut PgConnection, field: &str) -> Result<usize, Error>;
14}