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§
Sourcefn 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 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.
Sourcefn 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_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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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
Sourcefn get_consistency(&self) -> Consistency
fn get_consistency(&self) -> Consistency
Get the current consistency level.
Sourcefn set_consistency(&self, consistency: Consistency)
fn set_consistency(&self, consistency: Consistency)
Set the consistency level for subsequent queries.
Sourcefn get_serial_consistency(&self) -> Option<Consistency>
fn get_serial_consistency(&self) -> Option<Consistency>
Get the current serial consistency level.
Sourcefn set_serial_consistency(&self, consistency: Option<Consistency>)
fn set_serial_consistency(&self, consistency: Option<Consistency>)
Set the serial consistency level for subsequent queries.
Sourcefn set_tracing(&self, enabled: bool)
fn set_tracing(&self, enabled: bool)
Enable or disable request tracing.
Sourcefn is_tracing_enabled(&self) -> bool
fn is_tracing_enabled(&self) -> bool
Check if tracing is currently enabled.
Sourcefn last_trace_id(&self) -> Option<Uuid>
fn last_trace_id(&self) -> Option<Uuid>
Get the last tracing session ID (if tracing was enabled).
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.