Method: Sequel::MySQL::Dataset#update_sql
- Defined in:
- lib/sequel_core/adapters/mysql.rb
#update_sql(values, opts = nil, &block) ⇒ Object
MySQL supports ORDER and LIMIT clauses in UPDATE statements.
386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/sequel_core/adapters/mysql.rb', line 386 def update_sql(values, opts = nil, &block) sql = super opts = opts ? @opts.merge(opts) : @opts if order = opts[:order] sql << " ORDER BY #{column_list(order)}" end if limit = opts[:limit] sql << " LIMIT #{limit}" end sql end |