Class: Sequel::Snowflake::Dataset

Inherits:
ODBC::Dataset
  • Object
show all
Includes:
DatasetMethods
Defined in:
lib/sequel/adapters/snowflake.rb

Overview

A custom Sequel Dataset class crafted specifically to handle Snowflake results.

Instance Method Summary collapse

Methods included from DatasetMethods

#explain

Instance Method Details

#fetch_rows(sql) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sequel/adapters/snowflake.rb', line 26

def fetch_rows(sql)
  execute(sql) do |s|
    i = -1
    cols = s.columns(true).map{|c| [output_identifier(c.name), c.type, c.scale, i+=1]}
    columns = cols.map{|c| c[0]}
    self.columns = columns
    s.each do |row|
      hash = {}
      cols.each{|n,type,scale,j| hash[n] = convert_snowflake_value(row[j], type, scale)}
      yield hash
    end
  end
  self
end

#supports_merge?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/sequel/adapters/snowflake.rb', line 44

def supports_merge?
  true
end