Module: Torque::PostgreSQL::Adapter::ColumnMethods
- Included in:
- TableDefinition
- Defined in:
- lib/torque/postgresql/adapter/schema_definitions.rb
Instance Method Summary collapse
-
#composite(*names, composite_type:, **options) ⇒ Object
Add a composite type column to the table.
-
#lquery(*names, **options) ⇒ Object
Add a label tree pattern column to the table.
-
#ltree(*names, **options) ⇒ Object
Add a label tree column to the table.
-
#search_language(*names, **options) ⇒ Object
Adds a search language column to the table.
-
#search_vector(*names, columns:, **options) ⇒ Object
Add a search vector column to the table.
Instance Method Details
#composite(*names, composite_type:, **options) ⇒ Object
Add a composite type column to the table
22 23 24 25 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 22 def composite(*names, composite_type:, **) raise ArgumentError, "Missing column name(s) for composite" if names.empty? names.each { |name| column(name, :composite, composite_type: composite_type, **) } end |
#lquery(*names, **options) ⇒ Object
Add a label tree pattern column to the table
36 37 38 39 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 36 def lquery(*names, **) raise ArgumentError, "Missing column name(s) for lquery" if names.empty? names.each { |name| column(name, :lquery, **) } end |
#ltree(*names, **options) ⇒ Object
Add a label tree column to the table. Tree operators are only indexed
by GiST, as in index: { using: :gist }, whose default operator class
is already the right one for both a path and an array of paths
30 31 32 33 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 30 def ltree(*names, **) raise ArgumentError, "Missing column name(s) for ltree" if names.empty? names.each { |name| column(name, :ltree, **) } end |
#search_language(*names, **options) ⇒ Object
Adds a search language column to the table. See add_search_language
9 10 11 12 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 9 def search_language(*names, **) raise ArgumentError, "Missing column name(s) for search_language" if names.empty? names.each { |name| column(name, :regconfig, **) } end |
#search_vector(*names, columns:, **options) ⇒ Object
Add a search vector column to the table. See add_search_vector
15 16 17 18 19 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 15 def search_vector(*names, columns:, **) raise ArgumentError, "Missing column name(s) for search_vector" if names.empty? = Attributes::Builder.(columns: columns, **) names.each { |name| column(name, :virtual, **) } end |