Class | Sequel::Mysql2::Dataset
In: | lib/sequel/adapters/mysql2.rb
Parent: | Sequel::Dataset

Dataset class for MySQL datasets accessed via the native driver.

### Methods

delete fetch_rows insert replace update

### Included Modules

Sequel::MySQL::DatasetMethods Sequel::MySQL::PreparedStatements::DatasetMethods

### Constants

DatasetClass | = | self

### Public Instance methods

delete()

Delete rows matching this dataset

[Source]

         # File lib/sequel/adapters/mysql2.rb, line 134
    134:       def delete
    135:         execute_dui(delete_sql){|c| return c.affected_rows}
    136:       end

fetch_rows(sql, &block)

Yield all rows matching this dataset.

[Source]

         # File lib/sequel/adapters/mysql2.rb, line 139
    139:       def fetch_rows(sql, &block)
    140:         execute(sql) do |r|
    141:           @columns = r.fields
    142:           r.each(:cast_booleans => db.convert_tinyint_to_bool, &block)
    143:         end
    144:         self
    145:       end

insert(*values)

Insert a new value into this dataset

[Source]

         # File lib/sequel/adapters/mysql2.rb, line 148
    148:       def insert(*values)
    149:         execute_dui(insert_sql(*values)){|c| return c.last_id}
    150:       end

replace(*args)

Replace (update or insert) the matching row.

[Source]

         # File lib/sequel/adapters/mysql2.rb, line 153
    153:       def replace(*args)
    154:         execute_dui(replace_sql(*args)){|c| return c.last_id}
    155:       end

update(values={})

Update the matching rows.

[Source]

         # File lib/sequel/adapters/mysql2.rb, line 158
    158:       def update(values={})
    159:         execute_dui(update_sql(values)){|c| return c.affected_rows}
    160:       end

[Validate]