rails / arel

A Relational Algebra
2.06k stars 390 forks source link

Support INSERT with multiple values (v2) #484

Closed kirs closed 7 years ago

kirs commented 7 years ago

This is another attempt to implement support for INSERT queries with multiple values:

INSERT INTO people (name) VALUES ('dhh', 'rafael', 'kir')

This feature would allow me to speed up ActiveRecord fixtures (https://github.com/rails/rails/pull/26901).

The first implementation (https://github.com/rails/arel/pull/482) had to be reverted because it broke things. In this PR, I tried to design it in a way that the new feature wouldn't break any existing behaviour.

review @kamipo @rafaelfranca @matthewd

rails-bot commented 7 years ago

r? @rafaelfranca

(@rails-bot has picked a reviewer for you, use r? to override)

kirs commented 7 years ago

Thanks for a great review @matthewd! I've addressed the comments.

kirs commented 7 years ago

ping @kamipo @rafaelfranca @matthewd for a review when you have a minute

kirs commented 7 years ago

To make sure it doesn't break any Rails features like https://github.com/rails/arel/pull/482 did, I've run ActiveRecord test suite against this branch. It passes on sqlite3, mysql and postgres 👌