Class: ActiveRecord::ConnectionAdapters::SQLite3::Column
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveRecord::ConnectionAdapters::Column
|
Defined in: | activerecord/lib/active_record/connection_adapters/sqlite3/column.rb |
Class Method Summary
::ActiveRecord::ConnectionAdapters::Column
- Inherited
.new | Instantiates a new column in the table. |
Instance Attribute Summary
- #auto_increment? ⇒ Boolean readonly
- #auto_incremented_by_db? ⇒ Boolean readonly
- #has_default? ⇒ Boolean readonly
- #rowid readonly
- #virtual? ⇒ Boolean readonly
- #virtual_stored? ⇒ Boolean readonly
::ActiveRecord::ConnectionAdapters::Column
- Inherited
#limit, #precision, #scale, #sql_type, #type, | |
#auto_incremented_by_db? | whether the column is auto-populated by the database using a sequence. |
#auto_populated?, #bigint?, #collation, #comment, #default, #default_function, #has_default?, #name, #null, #sql_type_metadata, #virtual? |
Instance Method Summary
- #==(other) (also: #eql?)
- #encode_with(coder)
-
#eql?(other)
Alias for #==.
- #hash
- #init_with(coder)
::ActiveRecord::ConnectionAdapters::Column
- Inherited
#==, #encode_with, | |
#eql? | Alias for Column#==. |
#hash, | |
#human_name | Returns the human name of the column name. |
#init_with, #deduplicated |
::ActiveRecord::ConnectionAdapters::Deduplicable
- Included
#-@ | Alias for Deduplicable#deduplicate. |
#deduplicate, #deduplicated |
Constructor Details
.new(auto_increment: nil, rowid: false, generated_type: nil) ⇒ Column
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 9
def initialize(*, auto_increment: nil, rowid: false, generated_type: nil, **) super @auto_increment = auto_increment @rowid = rowid @generated_type = generated_type end
Instance Attribute Details
#auto_increment? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 16
def auto_increment? @auto_increment end
#auto_incremented_by_db? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 20
def auto_incremented_by_db? auto_increment? || rowid end
#has_default? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 32
def has_default? super && !virtual? end
#rowid (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 7
attr_reader :rowid
#virtual? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 24
def virtual? !@generated_type.nil? end
#virtual_stored? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 28
def virtual_stored? virtual? && @generated_type == :stored end
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 46
def ==(other) other.is_a?(Column) && super && auto_increment? == other.auto_increment? end
#encode_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 41
def encode_with(coder) coder["auto_increment"] = @auto_increment super end
#eql?(other)
Alias for #==.
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 51
alias :eql? :==
#hash
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 53
def hash Column.hash ^ super.hash ^ auto_increment?.hash ^ rowid.hash end
#init_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/column.rb', line 36
def init_with(coder) @auto_increment = coder["auto_increment"] super end