You put queries in a file `app/queries/foo.sql.erb`. Casting works and can be customised. There's ERB-support for parameterisation, with helpers like order_by and paginate.
The gem can parse and rewrite CTEs which allows for 1) rewriting the query such that basic queries (first, take, count etc.) are performant (Rails does `resultset.count`).
And 2) given your query contains CTEs, it allows to write tests per CTE.
You put queries in a file `app/queries/foo.sql.erb`. Casting works and can be customised. There's ERB-support for parameterisation, with helpers like order_by and paginate.
The gem can parse and rewrite CTEs which allows for 1) rewriting the query such that basic queries (first, take, count etc.) are performant (Rails does `resultset.count`). And 2) given your query contains CTEs, it allows to write tests per CTE.