scyllax 0.1.9-alpha

A SQLx and Discord inspired query system for Scylla
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{error::ScyllaxError, executor::GetPreparedStatement, queries::Query};
use async_trait::async_trait;
use scylla::{prepared_statement::PreparedStatement, Session};

/// A collection of prepared statements.
#[async_trait]
pub trait QueryCollection {
    async fn new(session: &Session) -> Result<Self, ScyllaxError>
    where
        Self: Sized;

    fn get_prepared<T: Query>(&self) -> &PreparedStatement
    where
        Self: GetPreparedStatement<T>,
    {
        <Self as GetPreparedStatement<T>>::get(self)
    }
}