diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-14 05:28:16 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-14 05:28:16 +0900 |
commit | 7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8 (patch) | |
tree | 3e25489974c4408ec8aad97f3a74a1a0a8954e00 /activerecord/test/models/pirate.rb | |
parent | ca18922ac23be2cde6963fae9b193c9111bec6f8 (diff) | |
download | rails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.tar.gz rails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.tar.bz2 rails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.zip |
Make `in_batches` queries to preparable
Before:
```sql
SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > 2 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > 4 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > 6 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > 8 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > 10 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
```
After:
```sql
SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 2], ["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 4], ["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 6], ["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 8], ["LIMIT", 2]]
SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 10], ["LIMIT", 2]]
```
Diffstat (limited to 'activerecord/test/models/pirate.rb')
0 files changed, 0 insertions, 0 deletions