Skip to main content

EntitySqlLogic

Trait EntitySqlLogic 

Source
pub trait EntitySqlLogic {
    // Provided methods
    fn get_entity_id_from_uid<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        uid: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<i32, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_optional_entity_id_from_uid<'life0, 'life1, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        uid: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<i32>, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_entity_id_from_space_name_version_drift_type<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        space: &'life1 str,
        name: &'life2 str,
        version: &'life3 str,
        drift_type: &'life4 str,
    ) -> Pin<Box<dyn Future<Output = Result<i32, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
    fn create_entity<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        space: &'life1 str,
        name: &'life2 str,
        version: &'life3 str,
        drift_type: &'life4 str,
    ) -> Pin<Box<dyn Future<Output = Result<(String, i32), SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
    fn get_uid_from_args<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        pool: &'life0 Pool<Postgres>,
        space: &'life1 str,
        name: &'life2 str,
        version: &'life3 str,
        drift_type: &'life4 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, SqlError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
}

Provided Methods§

Source

fn get_entity_id_from_uid<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, uid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<i32, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Get entity ID from UID

§Arguments
  • uid - The UID of the entity
§Returns
  • Result<i32, SqlError> - Result of the query returning the entity ID
Source

fn get_optional_entity_id_from_uid<'life0, 'life1, 'async_trait>( pool: &'life0 Pool<Postgres>, uid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<i32>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_entity_id_from_space_name_version_drift_type<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( pool: &'life0 Pool<Postgres>, space: &'life1 str, name: &'life2 str, version: &'life3 str, drift_type: &'life4 str, ) -> Pin<Box<dyn Future<Output = Result<i32, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn create_entity<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( pool: &'life0 Pool<Postgres>, space: &'life1 str, name: &'life2 str, version: &'life3 str, drift_type: &'life4 str, ) -> Pin<Box<dyn Future<Output = Result<(String, i32), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Helper function to create a new entity

§Arguments
  • space - The space of the entity
  • name - The name of the entity
  • version - The version of the entity
  • drift_type - The drift type of the entity
§Returns
  • Result<String, SqlError> - Result of the insert returning the new
Source

fn get_uid_from_args<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( pool: &'life0 Pool<Postgres>, space: &'life1 str, name: &'life2 str, version: &'life3 str, drift_type: &'life4 str, ) -> Pin<Box<dyn Future<Output = Result<String, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§