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 CassDataType

Caution

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

CassDataType¶

struct CassDataType¶

A data type used to describe a value, collection or user defined type.

Public Functions

CassDataType *cass_data_type_new(CassValueType type)¶

Creates a new data type with value type.

See also

cass_data_type_free()

Parameters:

type – [in]

Returns:

Returns a data type that must be freed.

CassDataType *cass_data_type_new_from_existing(const CassDataType *data_type)¶

Creates a new data type from an existing data type.

See also

cass_data_type_free()

Parameters:

data_type – [in]

Returns:

Returns a data type that must be freed.

CassDataType *cass_data_type_new_tuple(size_t item_count)¶

Creates a new tuple data type.

See also

cass_data_type_free()

Parameters:

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

Returns:

Returns a data type that must be freed.

CassDataType *cass_data_type_new_udt(size_t field_count)¶

Creates a new UDT (user defined type) data type.

See also

cass_data_type_free()

Parameters:

field_count – [in] The number of fields in the UDT

Returns:

Returns a data type that must be freed.

void cass_data_type_free(CassDataType *data_type)¶

Frees a data type instance.

Parameters:

data_type – [in]

CassValueType cass_data_type_type(const CassDataType *data_type)¶

Gets the value type of the specified data type.

Parameters:

data_type – [in]

Returns:

The value type

cass_bool_t cass_data_type_is_frozen(const CassDataType *data_type)¶

Gets whether a data type is frozen.

Parameters:

data_type – [in]

Returns:

cass_true if the data type is frozen, otherwise cass_false.

CassError cass_data_type_type_name(const CassDataType *data_type, const char **type_name, size_t *type_name_length)¶

Gets the type name of a UDT data type.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • type_name – [out]

  • type_name_length – [out]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_type_name(CassDataType *data_type, const char *type_name)¶

Sets the type name of a UDT data type.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • type_name – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_type_name_n(CassDataType *data_type, const char *type_name, size_t type_name_length)¶

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

Parameters:
  • data_type – [in]

  • type_name – [in]

  • type_name_length – [in]

Returns:

Returns a data type that must be freed.

CassError cass_data_type_keyspace(const CassDataType *data_type, const char **keyspace, size_t *keyspace_length)¶

Gets the type name of a UDT data type.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • keyspace – [out]

  • keyspace_length – [out]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_keyspace(CassDataType *data_type, const char *keyspace)¶

Sets the keyspace of a UDT data type.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • keyspace – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_keyspace_n(CassDataType *data_type, const char *keyspace, size_t keyspace_length)¶

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

Parameters:
  • data_type – [in]

  • keyspace – [in]

  • keyspace_length – [in]

Returns:

Returns a data type that must be freed.

CassError cass_data_type_class_name(const CassDataType *data_type, const char **class_name, size_t *class_name_length)¶

Gets the class name of a custom data type.

Note: Only valid for custom data types.

Parameters:
  • data_type – [in]

  • class_name – [out]

  • class_name_length – [out]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_class_name(CassDataType *data_type, const char *class_name)¶

Sets the class name of a custom data type.

Note: Only valid for custom data types.

Parameters:
  • data_type – [in]

  • class_name – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_set_class_name_n(CassDataType *data_type, const char *class_name, size_t class_name_length)¶

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

Parameters:
  • data_type – [in]

  • class_name – [in]

  • class_name_length – [in]

Returns:

Returns a data type that must be freed.

size_t cass_data_type_sub_type_count(const CassDataType *data_type)¶

Gets the sub-data type count of a UDT (user defined type), tuple or collection.

Note: Only valid for UDT, tuple and collection data types.

Parameters:

data_type – [in]

Returns:

Returns the number of sub-data types

const CassDataType *cass_data_type_sub_data_type(const CassDataType *data_type, size_t index)¶

Gets the sub-data type of a UDT (user defined type), tuple or collection at the specified index.

Note: Only valid for UDT, tuple and collection data types.

Parameters:
  • data_type – [in]

  • index – [in]

Returns:

Returns a reference to a child data type. Do not free this reference as it is bound to the lifetime of the parent data type. NULL is returned if the index is out of range.

const CassDataType *cass_data_type_sub_data_type_by_name(const CassDataType *data_type, const char *name)¶

Gets the sub-data type of a UDT (user defined type) at the specified index.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • name – [in]

Returns:

Returns a reference to a child data type. Do not free this reference as it is bound to the lifetime of the parent data type. NULL is returned if the name doesn’t exist.

const CassDataType *cass_data_type_sub_data_type_by_name_n(const CassDataType *data_type, const char *name, size_t name_length)¶

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

Parameters:
  • data_type – [in]

  • name – [in]

  • name_length – [in]

Returns:

Returns a reference to a child data type. Do not free this reference as it is bound to the lifetime of the parent data type. NULL is returned if the name doesn’t exist.

CassError cass_data_type_sub_type_name(const CassDataType *data_type, size_t index, const char **name, size_t *name_length)¶

Gets the sub-type name of a UDT (user defined type) at the specified index.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • index – [in]

  • name – [out]

  • name_length – [out]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_type(CassDataType *data_type, const CassDataType *sub_data_type)¶

Adds a sub-data type to a tuple or collection.

Note: Only valid for tuple and collection data types.

Parameters:
  • data_type – [in]

  • sub_data_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_type_by_name(CassDataType *data_type, const char *name, const CassDataType *sub_data_type)¶

Adds a sub-data type to a UDT (user defined type).

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • name – [in]

  • sub_data_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_type_by_name_n(CassDataType *data_type, const char *name, size_t name_length, const CassDataType *sub_data_type)¶

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

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • name – [in]

  • name_length – [in]

  • sub_data_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_value_type(CassDataType *data_type, CassValueType sub_value_type)¶

Adds a sub-data type to a tuple or collection using a value type.

Note: Only valid for tuple and collection data types.

Parameters:
  • data_type – [in]

  • sub_value_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_value_type_by_name(CassDataType *data_type, const char *name, CassValueType sub_value_type)¶

Adds a sub-data type to a UDT (user defined type) using a value type.

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • name – [in]

  • sub_value_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_data_type_add_sub_value_type_by_name_n(CassDataType *data_type, const char *name, size_t name_length, CassValueType sub_value_type)¶

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

Note: Only valid for UDT data types.

Parameters:
  • data_type – [in]

  • name – [in]

  • name_length – [in]

  • sub_value_type – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

Was this page helpful?

PREVIOUS
CassCustomPayload
NEXT
CassErrorResult
  • Create an issue
  • Edit this page

On this page

  • CassDataType
    • CassDataType
      • cass_data_type_new()
      • cass_data_type_new_from_existing()
      • cass_data_type_new_tuple()
      • cass_data_type_new_udt()
      • cass_data_type_free()
      • cass_data_type_type()
      • cass_data_type_is_frozen()
      • cass_data_type_type_name()
      • cass_data_type_set_type_name()
      • cass_data_type_set_type_name_n()
      • cass_data_type_keyspace()
      • cass_data_type_set_keyspace()
      • cass_data_type_set_keyspace_n()
      • cass_data_type_class_name()
      • cass_data_type_set_class_name()
      • cass_data_type_set_class_name_n()
      • cass_data_type_sub_type_count()
      • cass_data_type_sub_data_type()
      • cass_data_type_sub_data_type_by_name()
      • cass_data_type_sub_data_type_by_name_n()
      • cass_data_type_sub_type_name()
      • cass_data_type_add_sub_type()
      • cass_data_type_add_sub_type_by_name()
      • cass_data_type_add_sub_type_by_name_n()
      • cass_data_type_add_sub_value_type()
      • cass_data_type_add_sub_value_type_by_name()
      • cass_data_type_add_sub_value_type_by_name_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