Module: Sequel::ColumnsIntrospection

Defined in:
lib/sequel/extensions/columns_introspection.rb

Instance Method Summary collapse

Instance Method Details

#columnsObject

Attempt to guess the columns that will be returned if there are columns selected, in order to skip a database query to retrieve the columns. This should work with Symbols, SQL::Identifiers, SQL::QualifiedIdentifiers, and SQL::AliasedExpressions.



30
31
32
33
34
35
36
37
# File 'lib/sequel/extensions/columns_introspection.rb', line 30

def columns
  return @columns if @columns
  if (pcs = probable_columns) && pcs.all?
    self.columns = pcs
  else
    super
  end
end