struct CassStatement
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.
Functions
Creates a new query statement.
CassStatement *
cass_statement_new_n
(const char *
query, size_t
query_length, size_t
parameter_count )
Same as CassStatement::cass_statement_new
, but with lengths for string parameters.
Frees a statement instance. Statements can be immediately freed after being prepared, executed or added to a batch.
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.
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.
CassError
cass_statement_set_keyspace_n
(CassStatement *
statement, const char *
keyspace, size_t
keyspace_length )
Same as CassStatement::cass_statement_set_keyspace
, but with lengths for string parameters.
Sets the statement’s consistency level.
Default: CASS_CONSISTENCY_LOCAL_QUORUM
CassError
cass_statement_set_serial_consistency
(CassStatement *
statement, CassConsistency
serial_consistency )
Sets the statement’s serial consistency level.
Default: Not set
Sets the statement’s page size.
Default: -1 (Disabled)
Sets the statement’s paging state. This can be used to get the next page of data in a multi-page query.
CassError
cass_statement_set_paging_state_token
(CassStatement *
statement, const char *
paging_state, size_t
paging_state_size )
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.
Sets the statement’s timestamp.
CassError
cass_statement_set_retry_policy
(CassStatement *
statement, CassRetryPolicy *
retry_policy )
Sets the statement’s retry policy.
CassError
cass_statement_set_custom_payload
(CassStatement *
statement, const CassCustomPayload *
payload )
Sets the statement’s custom payload.
Binds null to a query or bound statement at the specified index.
Binds a null to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_null_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length )
Same as CassStatement::cass_statement_bind_null_by_name
, but with lengths for string parameters.
Binds a “tinyint” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int8_by_name
(CassStatement *
statement, const char *
name, cass_int8_t
value )
Binds a “tinyint” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_int8_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int8_t
value )
Same as CassStatement::cass_statement_bind_int8_by_name
, but with lengths for string parameters.
Binds an “smallint” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int16_by_name
(CassStatement *
statement, const char *
name, cass_int16_t
value )
Binds an “smallint” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_int16_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int16_t
value )
Same as CassStatement::cass_statement_bind_int16_by_name
, but with lengths for string parameters.
Binds an “int” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int32_by_name
(CassStatement *
statement, const char *
name, cass_int32_t
value )
Binds an “int” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_int32_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int32_t
value )
Same as CassStatement::cass_statement_bind_int32_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_uint32
(CassStatement *
statement, size_t
index, cass_uint32_t
value )
Binds a “date” to a query or bound statement at the specified index.
CassError
cass_statement_bind_uint32_by_name
(CassStatement *
statement, const char *
name, cass_uint32_t
value )
Binds a “date” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_uint32_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_uint32_t
value )
Same as CassStatement::cass_statement_bind_uint32_by_name
, but with lengths for string parameters.
Binds a “bigint”, “counter”, “timestamp” or “time” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int64_by_name
(CassStatement *
statement, const char *
name, cass_int64_t
value )
Binds a “bigint”, “counter”, “timestamp” or “time” to all values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_int64_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int64_t
value )
Same as CassStatement::cass_statement_bind_int64_by_name
, but with lengths for string parameters.
Binds a “float” to a query or bound statement at the specified index.
CassError
cass_statement_bind_float_by_name
(CassStatement *
statement, const char *
name, cass_float_t
value )
Binds a “float” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_float_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_float_t
value )
Same as CassStatement::cass_statement_bind_float_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_double
(CassStatement *
statement, size_t
index, cass_double_t
value )
Binds a “double” to a query or bound statement at the specified index.
CassError
cass_statement_bind_double_by_name
(CassStatement *
statement, const char *
name, cass_double_t
value )
Binds a “double” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_double_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_double_t
value )
Same as CassStatement::cass_statement_bind_double_by_name
, but with lengths for string parameters.
Binds a “boolean” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bool_by_name
(CassStatement *
statement, const char *
name, cass_bool_t
value )
Binds a “boolean” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_bool_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_bool_t
value )
Same as CassStatement::cass_statement_bind_bool_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_string
(CassStatement *
statement, size_t
index, const char *
value )
Binds an “ascii”, “text” or “varchar” to a query or bound statement at the specified index.
CassError
cass_statement_bind_string_n
(CassStatement *
statement, size_t
index, const char *
value, size_t
value_length )
Same as CassStatement::cass_statement_bind_string
, but with lengths for string parameters.
CassError
cass_statement_bind_string_by_name
(CassStatement *
statement, const char *
name, const char *
value )
Binds an “ascii”, “text” or “varchar” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_string_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const char *
value, size_t
value_length )
Same as CassStatement::cass_statement_bind_string_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_bytes
(CassStatement *
statement, size_t
index, const cass_byte_t *
value, size_t
value_size )
Binds a “blob”, “varint” or “custom” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bytes_by_name
(CassStatement *
statement, const char *
name, const cass_byte_t *
value, size_t
value_size )
Binds a “blob”, “varint” or “custom” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_bytes_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const cass_byte_t *
value, size_t
value_size )
Same as CassStatement::cass_statement_bind_bytes_by_name
, but with lengths for string parameters.
Binds a “uuid” or “timeuuid” to a query or bound statement at the specified index.
CassError
cass_statement_bind_uuid_by_name
(CassStatement *
statement, const char *
name, CassUuid
value )
Binds a “uuid” or “timeuuid” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_uuid_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, CassUuid
value )
Same as CassStatement::cass_statement_bind_uuid_by_name
, but with lengths for string parameters.
Binds an “inet” to a query or bound statement at the specified index.
CassError
cass_statement_bind_inet_by_name
(CassStatement *
statement, const char *
name, CassInet
value )
Binds an “inet” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_inet_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, CassInet
value )
Same as CassStatement::cass_statement_bind_inet_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_decimal
(CassStatement *
statement, size_t
index, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
scale )
Bind a “decimal” to a query or bound statement at the specified index.
CassError
cass_statement_bind_decimal_by_name
(CassStatement *
statement, const char *
name, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
scale )
Binds a “decimal” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_decimal_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
scale )
Same as CassStatement::cass_statement_bind_decimal_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_collection
(CassStatement *
statement, size_t
index, const CassCollection *
collection )
Bind a “list”, “map” or “set” to a query or bound statement at the specified index.
CassError
cass_statement_bind_collection_by_name
(CassStatement *
statement, const char *
name, const CassCollection *
collection )
Bind a “list”, “map” or “set” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_collection_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassCollection *
collection )
Same as CassStatement::cass_statement_bind_collection_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_tuple
(CassStatement *
statement, size_t
index, const CassTuple *
tuple )
Bind a “tuple” to a query or bound statement at the specified index.
CassError
cass_statement_bind_tuple_by_name
(CassStatement *
statement, const char *
name, const CassTuple *
tuple )
Bind a “tuple” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_tuple_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassTuple *
tuple )
Same as CassStatement::cass_statement_bind_tuple_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_user_type
(CassStatement *
statement, size_t
index, const CassUserType *
user_type )
Bind a user defined type to a query or bound statement at the specified index.
CassError
cass_statement_bind_user_type_by_name
(CassStatement *
statement, const char *
name, const CassUserType *
user_type )
Bind a user defined type to a query or bound statement with the specified name.
CassError
cass_statement_bind_user_type_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassUserType *
user_type )
Same as CassStatement::cass_statement_bind_user_type_by_name
, but with lengths for string parameters.