pub struct CassandraEngine { /* private fields */ }Expand description
Top-level query engine for the Cassandra driver.
Thin wrapper around CassandraPool that lets #[derive(Model)]-
generated Client<E> target Cassandra through the same codegen
pipeline the SQL drivers use. Routes SELECT/DELETE through the real
cdrs-tokio session; execute_update runs the UPDATE then re-
SELECTs rows matching the WHERE clause; execute_insert currently
returns [QueryError::unsupported] — the pool’s query/execute API
doesn’t accept bound params yet, so a safe PK-keyed follow-up
SELECT isn’t possible. Prefer [prax_scylladb::ScyllaEngine] for
typed Client inserts against any CQL-compatible cluster.
Implementations§
Source§impl CassandraEngine
impl CassandraEngine
Sourcepub fn new(pool: CassandraPool) -> Self
pub fn new(pool: CassandraPool) -> Self
Create a new engine wrapping the given pool.
Sourcepub fn pool(&self) -> &CassandraPool
pub fn pool(&self) -> &CassandraPool
Borrow the underlying pool. Exposed for callers that need to reach the raw query/execute/batch helpers directly.
Trait Implementations§
Source§impl Clone for CassandraEngine
impl Clone for CassandraEngine
Source§fn clone(&self) -> CassandraEngine
fn clone(&self) -> CassandraEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl QueryEngine for CassandraEngine
impl QueryEngine for CassandraEngine
Source§fn dialect(&self) -> &dyn SqlDialect
fn dialect(&self) -> &dyn SqlDialect
Source§fn query_many<T: Model + FromRow + Send + 'static>(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Vec<T>>>
fn query_many<T: Model + FromRow + Send + 'static>( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Vec<T>>>
Source§fn query_one<T: Model + FromRow + Send + 'static>(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<T>>
fn query_one<T: Model + FromRow + Send + 'static>( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<T>>
Source§fn query_optional<T: Model + FromRow + Send + 'static>(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Option<T>>>
fn query_optional<T: Model + FromRow + Send + 'static>( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Option<T>>>
Source§fn execute_insert<T: Model + FromRow + Send + 'static>(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<T>>
fn execute_insert<T: Model + FromRow + Send + 'static>( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<T>>
Source§fn execute_update<T: Model + FromRow + Send + 'static>(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Vec<T>>>
fn execute_update<T: Model + FromRow + Send + 'static>( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Vec<T>>>
Source§fn execute_delete(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn execute_delete( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Source§fn execute_raw(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn execute_raw( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Source§fn count(
&self,
sql: &str,
_params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn count( &self, sql: &str, _params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Source§fn aggregate_query(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<String, FilterValue>>, QueryError>> + Send + '_>>
fn aggregate_query( &self, sql: &str, params: Vec<FilterValue>, ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<String, FilterValue>>, QueryError>> + Send + '_>>
crate::filter::FilterValue
per result row. Read moreAuto Trait Implementations§
impl Freeze for CassandraEngine
impl !RefUnwindSafe for CassandraEngine
impl Send for CassandraEngine
impl Sync for CassandraEngine
impl Unpin for CassandraEngine
impl UnsafeUnpin for CassandraEngine
impl !UnwindSafe for CassandraEngine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more