![]() |
![]()
| ![]() |
![]()
NAME"Protocol::CassandraCQL::Type" - represents a Cassandra CQL data type DESCRIPTIONObjects in this class represent distinct types that may be found in Cassandra CQL3, either as columns in query result rows, or as bind parameters to prepared statements. It is used by Protocol::CassandraCQL::ColumnMeta. CONSTRUCTOR$type = Protocol::CassandraCQL::Type->from_frame( $frame )Returns a new type object initialised by parsing the type information in the given message frame. METHODS$name = $type->nameReturns a string representation of the type name. $bytes = $type->encode( $v )Encodes the given perl data into a bytestring. $v = $type->decode( $bytes )Decodes the given bytestring into perl data. $message = $type->validate( $v )Validates whether the given perl data is valid for this type. If so, returns false. Otherwise, returns an error message explaining why. COLLECTION TYPES$etype = $type->element_typeReturns the type of the elements in the list or set, for "LIST" and "SET" types. $ktype = $type->key_type$vtype = $type->value_typeReturns the type of the keys and values in the map, for "MAP" types. DATA ENCODINGSThe following encodings to and from perl data are supported: ASCIITo or from a string scalar, which must contain only US-ASCII codepoints (i.e. "ord" <= 127). BIGINT, BOOLEAN, COUNTER, DECIMAL, FLOAT, INTTo or from a numeric scalar. BLOBTo or from an opaque string scalar of bytes. DECIMALTo or from an instance of Math::BigFloat, or from a regular numeric scalar. TIMESTAMPTo or from a numeric scalar, representing a UNIX epoch timestamp as a float to the nearest milisecond. UUID, TIMEUUIDTo or from a string containing hex digits and hyphens, in the form "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx". VARCHARTo or from a string scalar containing Unicode characters. VARINTTo or from an instance of Math::BigInt, or from a regular numeric scalar. LIST, SETTo or from an "ARRAY" reference containing elements. MAPTo or from a "HASH" reference, where the keys used must be of some string type. SPONSORSThis code was paid for by
AUTHORPaul Evans <leonerd@leonerd.org.uk>
|