← All projects
Project record1 mention
Originally shared on Hacker News

AppQuery

A Ruby gem that makes raw SQL in Rails more intuitive. Queries live in files like app/queries/foo.sql.erb, with customizable casting, ERB-based parameterization, and helpers such as order_by and paginate. The gem parses and rewrites CTEs so basic operations (first, take, count) run performantly instead of using Rails' resultset.count, and it enables writing tests per CTE.

Last shared For Ruby on Rails developers working with raw SQL
01 / The problem

What it addresses

Raw SQL in Rails is unintuitive, and operations like Rails' resultset.count on custom queries can be slow and hard to test per-CTE.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. AppQuery

    A Ruby gem that makes raw SQL in Rails more intuitive. Queries live in files like app/queries/foo.sql.erb, with customizable casting, ERB-based parameterization, and helpers such as order_by and paginate. The gem parses and rewrites CTEs so basic operations (first, take, count) run performantly instead of using Rails' resultset.count, and it enables writing tests per CTE.

    Problem: Raw SQL in Rails is unintuitive, and operations like Rails' resultset.count on custom queries can be slow and hard to test per-CTE.

    Audience: Ruby on Rails developers working with raw SQL

    Posted by @doubleg · Original source ↗

    Source text · @doubleg · · Source ↗

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