Comment

Comment by doubleg

I'm working on AppQuery, a Ruby gem that makes raw SQL for Rails more intuitive https://rubygems.org/gems/appquery.

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.

parent doubleg 9 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton