Class: Amalgalite::Index
- Inherits:
-
Object
- Object
- Amalgalite::Index
- Defined in:
- lib/amalgalite/index.rb
Overview
a class representing the meta information about an SQLite index
Instance Attribute Summary collapse
-
#columns ⇒ Object
the columns that make up this index, in index order.
-
#name ⇒ Object
readonly
the name of the index.
-
#sequence_number ⇒ Object
sqlite sequence number of the index.
-
#sql ⇒ Object
readonly
the sql statement that created the index.
-
#table ⇒ Object
the table the index is for.
-
#unique ⇒ Object
writeonly
is the index unique.
Instance Method Summary collapse
-
#initialize(name, sql, table) ⇒ Index
constructor
A new instance of Index.
- #unique? ⇒ Boolean
Constructor Details
#initialize(name, sql, table) ⇒ Index
Returns a new instance of Index.
29 30 31 32 33 34 35 36 |
# File 'lib/amalgalite/index.rb', line 29 def initialize( name, sql, table ) @name = name @sql = sql @table = table @columns = [] @sequence_number = nil @unique = nil end |
Instance Attribute Details
#columns ⇒ Object
the columns that make up this index, in index order
21 22 23 |
# File 'lib/amalgalite/index.rb', line 21 def columns @columns end |
#name ⇒ Object (readonly)
the name of the index
12 13 14 |
# File 'lib/amalgalite/index.rb', line 12 def name @name end |
#sequence_number ⇒ Object
sqlite sequence number of the index
24 25 26 |
# File 'lib/amalgalite/index.rb', line 24 def sequence_number @sequence_number end |
#sql ⇒ Object (readonly)
the sql statement that created the index
15 16 17 |
# File 'lib/amalgalite/index.rb', line 15 def sql @sql end |
#table ⇒ Object
the table the index is for
18 19 20 |
# File 'lib/amalgalite/index.rb', line 18 def table @table end |
#unique=(value) ⇒ Object (writeonly)
is the index unique
27 28 29 |
# File 'lib/amalgalite/index.rb', line 27 def unique=(value) @unique = value end |
Instance Method Details
#unique? ⇒ Boolean
38 39 40 |
# File 'lib/amalgalite/index.rb', line 38 def unique? return @unique end |