module Sequel::Dataset::ColumnsLimit1

Constants

COLUMNS_CLONE_OPTIONS

Public Instance Methods

columns!() click to toggle source

Use a limit of 1 instead of a limit of 0 when getting the columns.

   # File lib/sequel/adapters/utils/columns_limit_1.rb
10 def columns!
11   ds = clone(COLUMNS_CLONE_OPTIONS)
12   ds.each{break}
13 
14   if cols = ds.cache[:_columns]
15     self.columns = cols
16   else
17     []
18   end
19 end