Rails 7.1 - construct Common Table Expression using .with query method

This page summarizes the projects mentioned and recommended in the original post on /r/rails

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • activerecord-cte

    Brings Common Table Expressions support to ActiveRecord and makes it super easy to build and chain complex CTE queries

  • Yes -- the whole CTE functionality was originally put in by Vlado Cingel (author of the activerecord-cte gem), and included support for recursion. Before the PR was merged though the recursive part got pulled out, leaving just .with(). In the future a .with_recursive() method might be put in to fill this gap.

  • brick

    Auto-generate models, views, controllers, and routes in a Rails app based on database structure (by lorint)

  • I had put this together in order to put it into a gem I maintain -- The Brick. The recursive part will be used to rapidly calculate inherited permissions.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts