Struct cassandra_cpp::Statement
[−]
[src]
pub struct Statement(_);
A statement object is an executable query. It represents either a regular (adhoc) statement or a prepared statement. It maintains the queries' parameter values along with query options (consistency level, paging state, etc.)
Note: Parameters for regular queries are not supported by the binary protocol version 1.
Methods
impl Statement
[src]
fn new(query: &str, parameter_count: usize) -> Self
Creates a new query statement.
fn add_key_index(&mut self, index: usize) -> Result<&mut Self>
Adds a key index specifier to this a statement. When using token-aware routing, this can be used to tell the driver which parameters within a non-prepared, parameterized statement are part of the partition key.
Use consecutive calls for composite partition keys.
This is not necessary for prepared statements, as the key parameters are determined in the metadata processed in the prepare phase.
fn set_keyspace(&mut self, keyspace: String) -> Result<&mut Self>
Sets the statement's keyspace for use with token-aware routing.
This is not necessary for prepared statements, as the keyspace is determined in the metadata processed in the prepare phase.
fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self>
Sets the statement's consistency level.
Default: CASS_CONSISTENCY_LOCAL_ONE
fn set_serial_consistency(
&mut self,
serial_consistency: Consistency
) -> Result<&mut Self>
&mut self,
serial_consistency: Consistency
) -> Result<&mut Self>
Sets the statement's serial consistency level.
Default: Not set
fn set_paging_size(&mut self, page_size: i32) -> Result<&mut Self>
Sets the statement's page size.
Default: -1 (Disabled)
fn set_paging_state(&mut self, result: CassResult) -> Result<&mut Self>
Sets the statement's paging state. This can be used to get the next page of data in a multi-page query.
fn set_paging_state_token(&mut self, paging_state: &str) -> Result<&mut Self>
Sets the statement's paging state. This can be used to get the next page of data in a multi-page query.
Warning: The paging state should not be exposed to or come from untrusted environments. The paging state could be spoofed and potentially used to gain access to other data.
fn set_timestamp(&mut self, timestamp: i64) -> Result<&mut Self>
Sets the statement's timestamp.
fn set_retry_policy(&mut self, retry_policy: RetryPolicy) -> Result<&mut Self>
Sets the statement's retry policy.
fn set_custom_payload(&mut self, payload: CustomPayload) -> Result<&mut Self>
Sets the statement's custom payload.
fn bind_null(&mut self, index: usize) -> Result<&mut Self>
Binds null to a query or bound statement at the specified index.
fn bind_null_by_name(&mut self, name: &str) -> Result<&mut Self>
Binds a null to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_int8(&mut self, index: usize, value: i8) -> Result<&mut Self>
Binds a "tinyint" to a query or bound statement at the specified index.
fn bind_int8_by_name(&mut self, name: &str, value: i8) -> Result<&mut Self>
Binds a "tinyint" to all the values with the specified name.
fn bind_int16(&mut self, index: usize, value: i16) -> Result<&mut Self>
Binds an "smallint" to a query or bound statement at the specified index.
fn bind_int16_by_name(&mut self, name: &str, value: i16) -> Result<&mut Self>
Binds a "smallint" to all the values with the specified name.
fn bind_int32(&mut self, index: usize, value: i32) -> Result<&mut Self>
Binds an "int" to a query or bound statement at the specified index.
fn bind_int32_by_name(&mut self, name: &str, value: i32) -> Result<&mut Self>
Binds an "int" to all the values with the specified name.
fn bind_uint32(&mut self, index: usize, value: u32) -> Result<&mut Self>
Binds a "date" to a query or bound statement at the specified index.
fn bind_uint32_by_name(&mut self, name: &str, value: u32) -> Result<&mut Self>
Binds a "date" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_int64(&mut self, index: usize, value: i64) -> Result<&mut Self>
Binds a "bigint", "counter", "timestamp" or "time" to a query or bound statement at the specified index.
fn bind_int64_by_name(&mut self, name: &str, value: i64) -> Result<&mut Self>
Binds a "bigint", "counter", "timestamp" or "time" to all values with the specified name.
fn bind_float(&mut self, index: usize, value: f32) -> Result<&mut Self>
Binds a "float" to a query or bound statement at the specified index.
fn bind_float_by_name(&mut self, name: &str, value: f32) -> Result<&mut Self>
Binds a "float" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_double(&mut self, index: usize, value: f64) -> Result<&mut Self>
Binds a "double" to a query or bound statement at the specified index.
fn bind_double_by_name(&mut self, name: &str, value: f64) -> Result<&mut Self>
Binds a "double" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_bool(&mut self, index: usize, value: bool) -> Result<&mut Self>
Binds a "boolean" to a query or bound statement at the specified index.
fn bind_bool_by_name(&mut self, name: &str, value: bool) -> Result<&mut Self>
Binds a "boolean" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_string(&mut self, index: usize, value: &str) -> Result<&mut Self>
Binds an "ascii", "text" or "varchar" to a query or bound statement at the specified index.
fn bind_string_by_name(&mut self, name: &str, value: &str) -> Result<&mut Self>
Binds an "ascii", "text" or "varchar" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_bytes(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self>
Binds a "blob", "varint" or "custom" to a query or bound statement at the specified index.
fn bind_bytes_by_name(
&mut self,
name: &str,
value: Vec<u8>
) -> Result<&mut Self>
&mut self,
name: &str,
value: Vec<u8>
) -> Result<&mut Self>
Binds a "blob", "varint" or "custom" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_uuid(&mut self, index: usize, value: Uuid) -> Result<&mut Self>
Binds a "uuid" or "timeuuid" to a query or bound statement at the specified index.
fn bind_uuid_by_name(&mut self, name: &str, value: Uuid) -> Result<&mut Self>
Binds a "uuid" or "timeuuid" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_inet(&mut self, index: usize, value: Inet) -> Result<&mut Self>
Binds an "inet" to a query or bound statement at the specified index.
fn bind_inet_by_name(&mut self, name: &str, value: Inet) -> Result<&mut Self>
Binds an "inet" to all the values with the specified name.
fn bind_map(&mut self, index: usize, map: Map) -> Result<&mut Self>
Bind a "map" to a query or bound statement at the specified index.
fn bind_map_by_name(&mut self, name: &str, map: Map) -> Result<&mut Self>
Bind a "map" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_set(&mut self, index: usize, collection: Set) -> Result<&mut Self>
Bind a "set" to a query or bound statement at the specified index.
fn bind_set_by_name(&mut self, name: &str, collection: Set) -> Result<&mut Self>
Bind a "set" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_list(&mut self, index: usize, collection: List) -> Result<&mut Self>
Bind a "list" to a query or bound statement at the specified index.
fn bind_list_by_name(
&mut self,
name: &str,
collection: List
) -> Result<&mut Self>
&mut self,
name: &str,
collection: List
) -> Result<&mut Self>
Bind a "list" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_tuple(&mut self, index: usize, value: Tuple) -> Result<&mut Self>
Bind a "tuple" to a query or bound statement at the specified index.
fn bind_tuple_by_name(&mut self, name: &str, value: Tuple) -> Result<&mut Self>
Bind a "tuple" to all the values with the specified name.
This can only be used with statements created by cass_prepared_bind().
fn bind_user_type(
&mut self,
index: usize,
value: &UserType
) -> Result<&mut Self>
&mut self,
index: usize,
value: &UserType
) -> Result<&mut Self>
Bind a user defined type to a query or bound statement at the specified index.
fn bind_user_type_by_name(
&mut self,
name: &str,
value: &UserType
) -> Result<&mut Self>
&mut self,
name: &str,
value: &UserType
) -> Result<&mut Self>
Bind a user defined type to a query or bound statement with the specified name.
Trait Implementations
impl Debug for Statement
[src]
impl Drop for Statement
[src]
fn drop(&mut self)
Frees a statement instance. Statements can be immediately freed after being prepared, executed or added to a batch.
impl BindRustType<bool> for Statement
[src]
fn bind(&mut self, index: usize, value: bool) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: bool) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<f32> for Statement
[src]
fn bind(&mut self, index: usize, value: f32) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: f32) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<f64> for Statement
[src]
fn bind(&mut self, index: usize, value: f64) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: f64) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<i32> for Statement
[src]
fn bind(&mut self, index: usize, value: i32) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: i32) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<i64> for Statement
[src]
fn bind(&mut self, index: usize, value: i64) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: i64) -> Result<&mut Self>
binds a rust type to C* by name
impl<'a> BindRustType<&'a str> for Statement
[src]
fn bind(&mut self, index: usize, value: &str) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: &str) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<Set> for Statement
[src]
fn bind(&mut self, index: usize, value: Set) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: Set) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<Uuid> for Statement
[src]
fn bind(&mut self, index: usize, value: Uuid) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: Uuid) -> Result<&mut Self>
binds a rust type to C* by name
impl BindRustType<Map> for Statement
[src]
fn bind(&mut self, index: usize, value: Map) -> Result<&mut Self>
binds a rust type to C* by index
fn bind_by_name(&mut self, col: &str, value: Map) -> Result<&mut Self>
binds a rust type to C* by name