For the most part, the stuff you do when constructing a query is Arel. Where you chain methods and such.
When it was first added to Rails, improving the query building possibilities, it was a separate gem that Rails depended on. I'm not sure if it was written specifically for Rails originally just maintained in a separate gem, or intended by it's original writers to be an independent project. But it was later absorbed into the Rails repo and we were later told by Rails maintainers that it's more sophisticated manual API (look up how to make a subquery with Arel for instance) were not intended as public API and had no backwards compat commitment.
When it was first added to Rails, improving the query building possibilities, it was a separate gem that Rails depended on. I'm not sure if it was written specifically for Rails originally just maintained in a separate gem, or intended by it's original writers to be an independent project. But it was later absorbed into the Rails repo and we were later told by Rails maintainers that it's more sophisticated manual API (look up how to make a subquery with Arel for instance) were not intended as public API and had no backwards compat commitment.