IME, which subset of features you use largely depends on the industry sector you’re in. There are many rails features I haven’t used in the past decade of working on rails apps, but they are important to some users.
CTEs are primarily useful when dealing with much larger databases and complex schemas. There are very few rails codebases old enough to have developed a highly-complex schema because rails isn’t very old.
Yes, that is true. It is a good coincidence that I work in one of those old enough codebases, maybe the oldest in active development.
However, as more rails applications become large and long-established, this feature will affect more developers.
I still doubt this. Like I said, working in a large scale application with a complex schema I didn’t needthis feature so far, so I think the size and complexity of the application doesn’t matter.
As a result, I think that at some point this will become an important feature. Whether it belongs in core right now hinges (imo) primarily on how much complexity the implementation adds.
Agree, but complexity is not only the number of lines the implementation requires.
To me the primary question that I need to answer is: do I want to maintain this feature for the next years given it can be implemented outside of the framework?
My answer right now is: no.
I’d prefer to spend the energy to maintain this code in other things like working to expose arel to public API, that would not only make CTE easier but also other kinds of complex queries.