module Sequel::Plugins::ColumnSelect::ClassMethods

Private Instance Methods

convert_input_dataset(ds) click to toggle source

If the underlying dataset selects from a single table and has no explicit selection, explicitly select all columns from that table, qualifying them with table's name.

Calls superclass method
# File lib/sequel/plugins/column_select.rb, line 41
def convert_input_dataset(ds)
  ds = super
  unless ds.opts[:select]
    if db.supports_schema_parsing?
      cols = check_non_connection_error(false){db.schema(ds)}
      if cols
        cols = cols.map{|c, _| c}
      end
    end

    if cols ||= check_non_connection_error(false){ds.columns}
      ds = ds.select(*cols.map{|c| Sequel.qualify(ds.first_source, Sequel.identifier(c))})
    end
  end
  ds
end