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 133
    133:       def delete
    134:         execute_dui(delete_sql){|c| return c.affected_rows}
    135:       end

fetch_rows(sql, &block)

Yield all rows matching this dataset.

[Source]

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

insert(*values)

Insert a new value into this dataset

[Source]

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

replace(*args)

Replace (update or insert) the matching row.

[Source]

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

update(values={})

Update the matching rows.

[Source]

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

[Validate]