Included modules
Constants
| PreparedStatementMethods | = | prepared_statements_module( "sql = self; opts = Hash[opts]; opts[:arguments] = bind_arguments", Sequel::Dataset::UnnumberedArgumentMapper, %w"execute execute_dui execute_insert") | ||
| STREAMING_SUPPORTED | = | ::Mysql2::VERSION >= '0.3.12' |
Public Instance methods
fetch_rows(sql)
[show source]
# File lib/sequel/adapters/mysql2.rb 248 def fetch_rows(sql) 249 execute(sql) do |r| 250 self.columns = r.fields.map!{|c| output_identifier(c.to_s)} 251 r.each(:cast_booleans=>convert_tinyint_to_bool?){|h| yield h} 252 end 253 self 254 end
paged_each(opts=OPTS, &block)
Use streaming to implement paging if Mysql2 supports it and it hasn’t been disabled.
[show source]
# File lib/sequel/adapters/mysql2.rb 258 def paged_each(opts=OPTS, &block) 259 if STREAMING_SUPPORTED && opts[:stream] != false 260 unless defined?(yield) 261 return enum_for(:paged_each, opts) 262 end 263 stream.each(&block) 264 else 265 super 266 end 267 end
stream()
Return a clone of the dataset that will stream rows when iterating over the result set, so it can handle large datasets that won’t fit in memory (Requires mysql 0.3.12+ to have an effect).
[show source]
# File lib/sequel/adapters/mysql2.rb 272 def stream 273 clone(:stream=>true) 274 end