Method: Sequel::Postgres::Dataset#fetch_rows

Defined in:
lib/sequel/adapters/postgres.rb

#fetch_rows(sql) ⇒ Object

Yield all rows returned by executing the given SQL and converting the types.



675
676
677
678
# File 'lib/sequel/adapters/postgres.rb', line 675

def fetch_rows(sql)
  return cursor_fetch_rows(sql){|h| yield h} if @opts[:cursor]
  execute(sql){|res| yield_hash_rows(res, fetch_rows_set_cols(res)){|h| yield h}}
end