Class: Sequel::Vertica::Dataset

Inherits:
Dataset
  • Object
show all
Defined in:
lib/sequel/adapters/vertica.rb

Constant Summary collapse

EXPLAIN =
'EXPLAIN '
EXPLAIN_LOCAL =
'EXPLAIN LOCAL '
QUERY_PLAN =
'QUERY PLAN'

Instance Method Summary collapse

Instance Method Details

#columnsObject



133
134
135
136
137
138
139
# File 'lib/sequel/adapters/vertica.rb', line 133

def columns
  return @columns if @columns
  ds = unfiltered.unordered.clone(:distinct => nil, :limit => 0, :offset => nil)
  res = @db.execute(ds.select_sql)
  @columns = res.columns.map { |c| c.name }
  @columns
end

#explain(opts = {}) ⇒ Object



147
148
149
# File 'lib/sequel/adapters/vertica.rb', line 147

def explain(opts={})
  execute((opts[:local] ? EXPLAIN_LOCAL : EXPLAIN) + select_sql).map { |k, v| k == QUERY_PLAN }.join("\$")
end

#fetch_rows(sql) ⇒ Object



141
142
143
144
145
# File 'lib/sequel/adapters/vertica.rb', line 141

def fetch_rows(sql)
  execute(sql) do |row|
    yield row
  end
end

#supports_regexp?Boolean

Returns:

  • (Boolean)


151
152
153
# File 'lib/sequel/adapters/vertica.rb', line 151

def supports_regexp?
  true
end