Was this page helpful?
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
- 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
- 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
- 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
- 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.
-
CassDataType *cass_data_type_new(CassValueType type)¶