Module: Sequel::Postgres::Streaming::DatasetMethods

Defined in:
lib/sequel_pg/streaming.rb

Overview

Dataset methods used to implement streaming.

Instance Method Summary collapse

Instance Method Details

#fetch_rows(sql, &block) ⇒ Object

If streaming has been requested and the current dataset can be streamed, request the database use streaming when executing this query.



39
40
41
42
43
44
45
# File 'lib/sequel_pg/streaming.rb', line 39

def fetch_rows(sql, &block)
  if stream_results?
    execute(sql, :stream=>[self, block])
  else
    super
  end
end

#streamObject

Return a clone of the dataset that will use streaming to load rows.



49
50
51
# File 'lib/sequel_pg/streaming.rb', line 49

def stream
  clone(:stream=>true)
end