Included Modules

Class Index [+]

Quicksearch

Sequel::Mysql2::Dataset

Dataset class for MySQL datasets accessed via the native driver.

Constants

DatasetClass

Public Instance Methods

fetch_rows(sql) click to toggle source

Yield all rows matching this dataset.

     # File lib/sequel/adapters/mysql2.rb, line 146
146:       def fetch_rows(sql)
147:         execute(sql) do |r|
148:           if identifier_output_method
149:             cols = r.fields
150:             @columns = cols2 = cols.map{|c| output_identifier(c.to_s)}
151:             cs = cols.zip(cols2)
152:             r.each(:cast_booleans => db.convert_tinyint_to_bool) do |row|
153:               h = {}
154:               cs.each do |a, b|
155:                 h[b] = row[a]
156:               end
157:               yield h
158:             end
159:           else
160:             @columns = r.fields
161:             r.each(:cast_booleans => db.convert_tinyint_to_bool){|h| yield h}
162:           end
163:         end
164:         self
165:       end

Private Instance Methods

execute(sql, opts={}, &block) click to toggle source

Set the :type option to :select if it hasn’t been set.

     # File lib/sequel/adapters/mysql2.rb, line 170
170:       def execute(sql, opts={}, &block)
171:         super(sql, {:type=>:select}.merge(opts), &block)
172:       end
literal_string_append(sql, v) click to toggle source

Handle correct quoting of strings using ::Mysql2::Client#escape.

     # File lib/sequel/adapters/mysql2.rb, line 175
175:       def literal_string_append(sql, v)
176:         sql << "'" << db.synchronize{|c| c.escape(v)} << "'"
177:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.