Method: Sequel::Dataset#columns!

Defined in:
lib/sequel/dataset/actions.rb

#columns!Object

Ignore any cached column information and perform a query to retrieve a row in order to get the columns.

DB[:table].columns!
# => [:id, :name]


105
106
107
108
109
110
111
112
113
114
# File 'lib/sequel/dataset/actions.rb', line 105

def columns!
  ds = clone(COLUMNS_CLONE_OPTIONS)
  ds.each{break}

  if cols = ds.cache[:_columns]
    self.columns = cols
  else
    []
  end
end