Class: Daru::IO::SqlDataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/daru/io/sql_data_source.rb

Defined Under Namespace

Classes: Adapter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db, query) ⇒ SqlDataSource

Returns a new instance of SqlDataSource.



62
63
64
# File 'lib/daru/io/sql_data_source.rb', line 62

def initialize(db, query)
  @adapter = init_adapter(db, query)
end

Class Method Details

.make_dataframe(db, query) ⇒ Object



58
59
60
# File 'lib/daru/io/sql_data_source.rb', line 58

def self.make_dataframe(db, query)
  new(db, query).make_dataframe
end

Instance Method Details

#make_dataframeObject



66
67
68
# File 'lib/daru/io/sql_data_source.rb', line 66

def make_dataframe
  Daru::DataFrame.new(@adapter.result_hash).tap(&:update)
end