class ROM::SQL::Schema::DSL

Specialized schema DSL with SQL-specific features

@api public

Attributes

index_dsl[R]

@!attribute [r] index_dsl

@return [IndexDSL] Index DSL instance (created only if indexes block is called)

Public Instance Methods

indexes(&block) click to toggle source

Define indexes within a block

@api public

# File lib/rom/sql/schema/dsl.rb, line 19
def indexes(&block)
  @index_dsl = IndexDSL.new(**options, &block)
end

Private Instance Methods

opts() click to toggle source

Return schema options

@api private

Calls superclass method
# File lib/rom/sql/schema/dsl.rb, line 28
def opts
  if index_dsl
    opts = super

    { **opts, indexes: index_dsl.(relation, opts[:attributes]) }
  else
    super
  end
end