Reference
< Object
The CQL::Index
class represents an index on a table. Indexes are used to optimize query performance by providing faster access to data. This class provides methods for defining the columns that make up the index and specifying whether the index is unique.
Creates a new index on the specified table.
@param table [Table] The table on which the index is created.
@param columns [Array(Symbol)] The columns that make up the index.
@param unique [Bool] Whether the index should enforce uniqueness (default: false
).
@return [Index] The created index object.
Example:
Specifies whether the index is unique.
@return [Bool] true
if the index is unique, false
otherwise.
Example:
Generates a name for the index based on the table and columns.
@return [String] The generated index name.
Example: