rails / arel

A Relational Algebra
2.06k stars 390 forks source link

Support multiple inserts #482

Closed kirs closed 7 years ago

kirs commented 7 years ago

Implements https://github.com/rails/arel/issues/464

rails-bot commented 7 years ago

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @tenderlove (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

kirs commented 7 years ago

@tenderlove @rafaelfranca this PR adds Arel support for multiple inserts (INSERT INTO cats (names) VALUES ('gorby'), ('choo choo'). This feature would help me to speed up fixtures inserts in Rails (https://github.com/rails/rails/pull/26901) without concatenating strings manually.

Who would be the best person to review this? I would ask Sean but he's on parental leave these days.

matthewd commented 7 years ago

It's also possible/likely there are callers who expect a Values node to actually work (e.g. in a from clause)