Class: Webhookdb::DBAdapter::Column
- Inherits:
-
TypedStruct
- Object
- TypedStruct
- Webhookdb::DBAdapter::Column
- Includes:
- ColumnTypes
- Defined in:
- lib/webhookdb/db_adapter.rb
Constant Summary
Constants included from ColumnTypes
Webhookdb::DBAdapter::ColumnTypes::BIGINT, Webhookdb::DBAdapter::ColumnTypes::BIGINT_ARRAY, Webhookdb::DBAdapter::ColumnTypes::BOOLEAN, Webhookdb::DBAdapter::ColumnTypes::COLUMN_TYPES, Webhookdb::DBAdapter::ColumnTypes::DATE, Webhookdb::DBAdapter::ColumnTypes::DECIMAL, Webhookdb::DBAdapter::ColumnTypes::DOUBLE, Webhookdb::DBAdapter::ColumnTypes::FLOAT, Webhookdb::DBAdapter::ColumnTypes::INTEGER, Webhookdb::DBAdapter::ColumnTypes::INTEGER_ARRAY, Webhookdb::DBAdapter::ColumnTypes::OBJECT, Webhookdb::DBAdapter::ColumnTypes::TEXT, Webhookdb::DBAdapter::ColumnTypes::TEXT_ARRAY, Webhookdb::DBAdapter::ColumnTypes::TIMESTAMP, Webhookdb::DBAdapter::ColumnTypes::UUID
Instance Attribute Summary collapse
-
#backfill_expr ⇒ Object
readonly
Returns the value of attribute backfill_expr.
-
#backfill_statement ⇒ Object
readonly
Returns the value of attribute backfill_statement.
-
#index ⇒ Object
(also: #index?)
readonly
Returns the value of attribute index.
-
#index_where ⇒ Object
readonly
Returns the value of attribute index_where.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nullable ⇒ Object
(also: #nullable?)
readonly
Returns the value of attribute nullable.
-
#pk ⇒ Object
(also: #pk?)
readonly
Returns the value of attribute pk.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#unique ⇒ Object
(also: #unique?)
readonly
Returns the value of attribute unique.
Instance Method Summary collapse
- #_defaults ⇒ Object
-
#initialize(**kwargs) ⇒ Column
constructor
A new instance of Column.
Methods inherited from TypedStruct
#[], #_apply, #as_json, #change
Constructor Details
#initialize(**kwargs) ⇒ Column
Returns a new instance of Column.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/webhookdb/db_adapter.rb', line 45 def initialize(**kwargs) super self.typecheck!(:name, Symbol) self.typecheck!(:type, Symbol) self.typecheck!(:nullable, :boolean) self.typecheck!(:unique, :boolean) self.typecheck!(:index, :boolean) self.typecheck!(:pk, :boolean) raise ArgumentError, "type #{self.type.inspect} is not known" unless COLUMN_TYPES.include?(self.type) end |
Instance Attribute Details
#backfill_expr ⇒ Object (readonly)
Returns the value of attribute backfill_expr.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def backfill_expr @backfill_expr end |
#backfill_statement ⇒ Object (readonly)
Returns the value of attribute backfill_statement.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def backfill_statement @backfill_statement end |
#index ⇒ Object (readonly) Also known as: index?
Returns the value of attribute index.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def index @index end |
#index_where ⇒ Object (readonly)
Returns the value of attribute index_where.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def index_where @index_where end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def name @name end |
#nullable ⇒ Object (readonly) Also known as: nullable?
Returns the value of attribute nullable.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def nullable @nullable end |
#pk ⇒ Object (readonly) Also known as: pk?
Returns the value of attribute pk.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def pk @pk end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def type @type end |
#unique ⇒ Object (readonly) Also known as: unique?
Returns the value of attribute unique.
39 40 41 |
# File 'lib/webhookdb/db_adapter.rb', line 39 def unique @unique end |
Instance Method Details
#_defaults ⇒ Object
56 57 58 |
# File 'lib/webhookdb/db_adapter.rb', line 56 def _defaults return {nullable: true, unique: false, index: false, pk: false} end |