CqlDriver

Trait CqlDriver 

Source
pub trait CqlDriver: Send + Sync {
Show 25 methods // Required methods fn connect<'life0, 'async_trait>( config: &'life0 ConnectionConfig, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where Self: Sized + 'async_trait, 'life0: 'async_trait; fn execute_unpaged<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn execute_paged<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, page_size: i32, ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn prepare<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PreparedId>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn execute_prepared<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prepared_id: &'life1 PreparedId, values: &'life2 [CqlValue], ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn use_keyspace<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_consistency(&self) -> Consistency; fn set_consistency(&self, consistency: Consistency); fn get_serial_consistency(&self) -> Option<Consistency>; fn set_serial_consistency(&self, consistency: Option<Consistency>); fn set_tracing(&self, enabled: bool); fn is_tracing_enabled(&self) -> bool; fn last_trace_id(&self) -> Option<Uuid>; fn get_trace_session<'life0, 'async_trait>( &'life0 self, trace_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<TracingSession>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_keyspaces<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<KeyspaceMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_tables<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TableMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_table_metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, keyspace: &'life1 str, table: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<TableMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_udts<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<UdtMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_functions<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FunctionMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_aggregates<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateMetadata>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_cluster_name<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_cql_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_release_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_scylla_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn is_connected<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

The core driver trait abstracting database operations.

All methods are async and return Result for proper error propagation. Implementations must be Send + Sync for use across async tasks.

Required Methods§

Source

fn connect<'life0, 'async_trait>( config: &'life0 ConnectionConfig, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Establish a connection to the database cluster.

Source

fn execute_unpaged<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a raw CQL query string without parameters.

Source

fn execute_paged<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, page_size: i32, ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a CQL query with automatic paging, returning all rows.

Source

fn prepare<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PreparedId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prepare a CQL statement for repeated execution.

Source

fn execute_prepared<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prepared_id: &'life1 PreparedId, values: &'life2 [CqlValue], ) -> Pin<Box<dyn Future<Output = Result<CqlResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a previously prepared statement with the given values.

Source

fn use_keyspace<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Switch the current keyspace (USE ).

Source

fn get_consistency(&self) -> Consistency

Get the current consistency level.

Source

fn set_consistency(&self, consistency: Consistency)

Set the consistency level for subsequent queries.

Source

fn get_serial_consistency(&self) -> Option<Consistency>

Get the current serial consistency level.

Source

fn set_serial_consistency(&self, consistency: Option<Consistency>)

Set the serial consistency level for subsequent queries.

Source

fn set_tracing(&self, enabled: bool)

Enable or disable request tracing.

Source

fn is_tracing_enabled(&self) -> bool

Check if tracing is currently enabled.

Source

fn last_trace_id(&self) -> Option<Uuid>

Get the last tracing session ID (if tracing was enabled).

Source

fn get_trace_session<'life0, 'async_trait>( &'life0 self, trace_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<TracingSession>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve tracing session data for a given trace ID.

Source

fn get_keyspaces<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<KeyspaceMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get metadata for all keyspaces.

Source

fn get_tables<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TableMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get metadata for all tables in a keyspace.

Source

fn get_table_metadata<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, keyspace: &'life1 str, table: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<TableMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get metadata for a specific table.

Source

fn get_udts<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<UdtMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get metadata for all user-defined types in a keyspace.

Source

fn get_functions<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FunctionMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get metadata for all user-defined functions in a keyspace.

Source

fn get_aggregates<'life0, 'life1, 'async_trait>( &'life0 self, keyspace: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AggregateMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get metadata for all user-defined aggregates in a keyspace.

Source

fn get_cluster_name<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the cluster name.

Source

fn get_cql_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the CQL version from the connected node.

Source

fn get_release_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the release version of the connected node.

Source

fn get_scylla_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the ScyllaDB version (None if not ScyllaDB).

Source

fn is_connected<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if the connection is still alive.

Implementors§