1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel
Ryuta Kamizono 859fba7c4b Handle DELETE with LIMIT in Arel
MySQL supports DELETE with LIMIT and ORDER BY.

https://dev.mysql.com/doc/refman/8.0/en/delete.html

Before:

```
  Post Destroy (1.0ms)  DELETE FROM `posts` WHERE `posts`.`id` IN (SELECT `id` FROM (SELECT `posts`.`id` FROM `posts` WHERE `posts`.`author_id` = ? ORDER BY `posts`.`id` ASC LIMIT ?) __active_record_temp)  [["author_id", 1], ["LIMIT", 1]]
```

After:

```
  Post Destroy (0.4ms)  DELETE FROM `posts` WHERE `posts`.`author_id` = ? ORDER BY `posts`.`id` ASC LIMIT ?  [["author_id", 1], ["LIMIT", 1]]
```
2018-09-30 21:21:54 +09:00
..
attributes Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
collectors SQLString#compile is no longer used since 53521a9e39 2018-09-30 16:49:13 +09:00
compatibility Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
nodes Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
visitors Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
alias_predication.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
attributes.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
crud.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
delete_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
errors.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
expressions.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
factory_methods.rb Make update_counters preparable 2018-09-28 04:14:15 +09:00
insert_manager.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
math.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
nodes.rb
order_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
select_manager.rb Abandon TOP support. 2018-09-25 15:39:14 +04:00
table.rb Use private attr_reader in Arel 2018-09-30 15:24:17 +09:00
tree_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
update_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
visitors.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
window_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30