Module: SimpleQuery::Stream::MysqlStream
- Included in:
- Builder
- Defined in:
- lib/simple_query/stream/mysql_stream.rb
Instance Method Summary collapse
Instance Method Details
#stream_each_mysql(&block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/simple_query/stream/mysql_stream.rb', line 6 def stream_each_mysql(&block) select_sql = cached_sql raw_conn = ActiveRecord::Base.connection.raw_connection result = raw_conn.query(select_sql, stream: true, cache_rows: false, as: :hash) result.each do |mysql_row| record = build_row_object_mysql(mysql_row) block.call(record) end end |