ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Ask AI
ScyllaDB Docs ScyllaDB CPP RS Driver API Documentation CassTuple

Caution

You're viewing documentation for an unstable version of ScyllaDB CPP RS Driver. Switch to the latest stable version.

CassTuple¶

struct CassTuple¶

A tuple of values.

Public Functions

CassTuple *cass_tuple_new(size_t item_count)¶

Creates a new tuple.

See also

cass_tuple_free()

Parameters:

item_count – [in] The number of items in the tuple.

Returns:

Returns a tuple that must be freed.

CassTuple *cass_tuple_new_from_data_type(const CassDataType *data_type)¶

Creates a new tuple from an existing data type.

See also

cass_tuple_free();

Parameters:

data_type – [in]

Returns:

Returns a tuple that must be freed.

void cass_tuple_free(CassTuple *tuple)¶

Frees a tuple instance.

Parameters:

tuple – [in]

const CassDataType *cass_tuple_data_type(const CassTuple *tuple)¶

Gets the data type of a tuple.

Parameters:

tuple – [in]

Returns:

Returns a reference to the data type of the tuple. Do not free this reference as it is bound to the lifetime of the tuple.

CassError cass_tuple_set_null(CassTuple *tuple, size_t index)¶

Sets an null in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_int8(CassTuple *tuple, size_t index, cass_int8_t value)¶

Sets a “tinyint” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_int16(CassTuple *tuple, size_t index, cass_int16_t value)¶

Sets an “smallint” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_int32(CassTuple *tuple, size_t index, cass_int32_t value)¶

Sets an “int” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_uint32(CassTuple *tuple, size_t index, cass_uint32_t value)¶

Sets a “date” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_int64(CassTuple *tuple, size_t index, cass_int64_t value)¶

Sets a “bigint”, “counter”, “timestamp” or “time” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_float(CassTuple *tuple, size_t index, cass_float_t value)¶

Sets a “float” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_double(CassTuple *tuple, size_t index, cass_double_t value)¶

Sets a “double” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_bool(CassTuple *tuple, size_t index, cass_bool_t value)¶

Sets a “boolean” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_string(CassTuple *tuple, size_t index, const char *value)¶

Sets an “ascii”, “text” or “varchar” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in] The value is copied into the tuple object; the memory pointed to by this parameter can be freed after this call.

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_string_n(CassTuple *tuple, size_t index, const char *value, size_t value_length)¶

Same as cass_tuple_set_string(), but with lengths for string parameters.

See also

cass_tuple_set_string();

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

  • value_length – [in]

Returns:

same as cass_tuple_set_string()

CassError cass_tuple_set_bytes(CassTuple *tuple, size_t index, const cass_byte_t *value, size_t value_size)¶

Sets a “blob”, “varint” or “custom” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in] The value is copied into the tuple object; the memory pointed to by this parameter can be freed after this call.

  • value_size – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_uuid(CassTuple *tuple, size_t index, CassUuid value)¶

Sets a “uuid” or “timeuuid” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_inet(CassTuple *tuple, size_t index, CassInet value)¶

Sets an “inet” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_decimal(CassTuple *tuple, size_t index, const cass_byte_t *varint, size_t varint_size, cass_int32_t scale)¶

Sets a “decimal” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • varint – [in] The value is copied into the tuple object; the memory pointed to by this parameter can be freed after this call.

  • varint_size – [in]

  • scale – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_duration(CassTuple *tuple, size_t index, cass_int32_t months, cass_int32_t days, cass_int64_t nanos)¶

Sets a “duration” in a tuple at the specified index.

Requires Apache Cassandra: 3.10+

Parameters:
  • tuple – [in]

  • index – [in]

  • months – [in]

  • days – [in]

  • nanos – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_collection(CassTuple *tuple, size_t index, const CassCollection *value)¶

Sets a “list”, “map” or “set” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_tuple(CassTuple *tuple, size_t index, const CassTuple *value)¶

Sets a “tuple” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_user_type(CassTuple *tuple, size_t index, const CassUserType *value)¶

Sets a “udt” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_custom(CassTuple *tuple, size_t index, const char *class_name, const cass_byte_t *value, size_t value_size)¶

Sets a “custom” in a tuple at the specified index.

Parameters:
  • tuple – [in]

  • index – [in]

  • class_name – [in]

  • value – [in] The value is copied into the tuple object; the memory pointed to by this parameter can be freed after this call.

  • value_size – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_tuple_set_custom_n(CassTuple *tuple, size_t index, const char *class_name, size_t class_name_length, const cass_byte_t *value, size_t value_size)¶

Same as cass_tuple_set_custom(), but with lengths for string parameters.

See also

cass_tuple_set_custom()

Parameters:
  • tuple – [in]

  • index – [in]

  • class_name – [in]

  • class_name_length – [in]

  • value – [in]

  • value_size – [in]

Returns:

same as cass_tuple_set_custom()

Was this page helpful?

PREVIOUS
CassTimestampGen
NEXT
CassUserType
  • Create an issue
  • Edit this page

On this page

  • CassTuple
    • CassTuple
      • cass_tuple_new()
      • cass_tuple_new_from_data_type()
      • cass_tuple_free()
      • cass_tuple_data_type()
      • cass_tuple_set_null()
      • cass_tuple_set_int8()
      • cass_tuple_set_int16()
      • cass_tuple_set_int32()
      • cass_tuple_set_uint32()
      • cass_tuple_set_int64()
      • cass_tuple_set_float()
      • cass_tuple_set_double()
      • cass_tuple_set_bool()
      • cass_tuple_set_string()
      • cass_tuple_set_string_n()
      • cass_tuple_set_bytes()
      • cass_tuple_set_uuid()
      • cass_tuple_set_inet()
      • cass_tuple_set_decimal()
      • cass_tuple_set_duration()
      • cass_tuple_set_collection()
      • cass_tuple_set_tuple()
      • cass_tuple_set_user_type()
      • cass_tuple_set_custom()
      • cass_tuple_set_custom_n()
ScyllaDB CPP RS Driver
  • master
    • master
    • v1.0.0
  • ScyllaDB CPP RS Driver
  • API Documentation
    • BasicTypes
    • CassConsistency
    • CassError
    • CassValueType
    • CustomAllocator
    • Logging
    • Miscellaneous
    • CassAggregateMeta
    • CassAuthenticator
    • CassAuthenticatorCallbacks
    • CassBatch
    • CassCluster
    • CassCollection
    • CassColumnMeta
    • CassCustomPayload
    • CassDataType
    • CassErrorResult
    • CassExecProfile
    • CassFunctionMeta
    • CassFuture
    • CassIndexMeta
    • CassInet
    • CassIterator
    • CassKeyspaceMeta
    • CassMaterializedViewMeta
    • CassMetrics
    • CassNode
    • CassPrepared
    • CassResult
    • CassRetryPolicy
    • CassRow
    • CassSchemaMeta
    • CassSession
    • CassSpeculativeExecutionMetrics
    • CassSsl
    • CassStatement
    • CassTableMeta
    • CassTimestampGen
    • CassTuple
    • CassUserType
    • CassUuid
    • CassUuidGen
    • CassValue
    • CassVersion
  • Getting Started
  • Architecture Overview
  • Installation
  • Building
  • Testing
  • Using the Driver
    • Batches
    • Binding Parameters
    • Client-side timestamps
    • Consistency
    • Data Types
      • The date and time Types
      • Tuples
      • User-Defined Types (UDTs)
      • UUIDs
    • Futures
    • Handling Results
    • Keyspaces
    • Prepared Statements
    • Schema Metadata
  • Configuration
    • Load balancing
    • Retry policies
    • Speculative Execution
    • Connection
    • Execution Profiles
    • Performance Tips
    • Client Configuration
  • Security
    • Authentication
    • TLS
  • Observability
    • Logging
    • Tracing
    • Metrics
Docs Tutorials University Contact Us About Us
© 2026, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 17 Mar 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.1
Ask AI