class Cql::Index
- Cql::Index
- Reference
- Object
Overview
An index on a table This class represents an index on a table It provides methods for setting the columns and unique constraint It also provides methods for generating the index name
Example Creating a new index
schema.build do
table :users do
column :name, String
column :email, String
index [:name, :email], unique: true
end
end
Defined in:
index.crConstructors
Instance Method Summary
- #columns : Array(Symbol)
- #index_name
- #name : String | Nil
- #name=(name : String | Nil)
- #table : Table
- #unique? : Bool
Constructor Detail
def self.new(table : Table, columns : Array(Symbol), unique : Bool = false, name : String | Nil = nil)
#