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

### Public Instance methods

delete()

Delete rows matching this dataset

[Source]

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

fetch_rows(sql, &block)

Yield all rows matching this dataset.

[Source]

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

insert(*values)

Insert a new value into this dataset

[Source]

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

replace(*args)

Replace (update or insert) the matching row.

[Source]

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

update(values={})

Update the matching rows.

[Source]

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

[Validate]