Integer Types
CQL provides several fixed-size integer types that map directly to Rust’s primitive integer types.TinyInt
8-bit signed integer.SmallInt
16-bit signed integer.Int
32-bit signed integer. This is the default integer type in CQL.BigInt
64-bit signed integer.Varint
Arbitrary-precision signed integer. CQL represents this as a two’s complement big-endian byte array.Using num_bigint (Optional)
For more convenient varint operations, enable thenum-bigint-03 or num-bigint-04 feature:
Floating-Point Types
Float
32-bit IEEE-754 floating point number.Double
64-bit IEEE-754 floating point number.Boolean
Boolean value (true or false).Blob
Binary data of arbitrary length. CQL blobs map to various Rust byte containers.Decimal
Variable-precision decimal number, represented as an arbitrary-precision integer and a scale.Using bigdecimal (Optional)
For more convenient decimal operations, enable thebigdecimal-04 feature:
Counter
Counter is a special 64-bit integer type used for distributed counters. Counters can only be incremented or decremented.- They must be in a table where all non-primary-key columns are counters
- They can only be updated using
UPDATEstatements with+or-operations - They cannot be part of the primary key
Inet
IPv4 or IPv6 address.Empty Values
Some primitive types support a special “empty” value (distinct from null) represented as 0 bytes. This is a quirk of CQL where certain types can have an additional value.See Also
- Text Types - Working with strings
- UUID Types - Unique identifiers
- Date and Time Types - Timestamps and dates
