Sha256: a65b4391093df32ca0c7d1f323529af57af3d1f7e752b9c9dd26908c68143170

Contents?: true

Size: 560 Bytes

Versions: 46

Compression:

Stored size: 560 Bytes

Contents

# frozen-string-literal: true

module Sequel
  class Dataset
    module ColumnsLimit1
      COLUMNS_CLONE_OPTIONS = {:distinct => nil, :limit => 1, :offset=>nil, :where=>nil, :having=>nil, :order=>nil, :row_proc=>nil, :graph=>nil, :eager_graph=>nil}.freeze

      # Use a limit of 1 instead of a limit of 0 when
      # getting the columns.
      def columns!
        ds = clone(COLUMNS_CLONE_OPTIONS)
        ds.each{break}

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

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
sequel-5.88.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.87.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.86.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.85.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.84.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.83.1 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.83.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.82.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.81.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.80.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.79.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.78.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.77.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.76.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.75.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.74.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.73.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.72.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.71.0 lib/sequel/adapters/utils/columns_limit_1.rb
sequel-5.70.0 lib/sequel/adapters/utils/columns_limit_1.rb