Super_template

screenshot of Super_template

SQL Template for Ruby

Overview:

Super Template is a library that allows users to generate SQL and also serves as a general template library. It enables users to maintain their raw SQL logic in Ruby on Rails using plain old Ruby objects. With Super Template, SQL templates can be easily reused without the need to rewrite similar SQL logic repeatedly. This library is inspired by ViewComponent.

Features:

  • Generate SQL: Super Template allows users to generate SQL logic easily.
  • General Template Library: Besides SQL generation, this library also serves as a general template library.
  • Reusable SQL Templates: Users can reuse SQL templates without the need to rewrite similar SQL logic.
  • Ruby Object: Templates are implemented as Ruby objects, making them easy to work with.
  • Template Generator: Super Template provides a template generator to create new SQL templates.
  • ActiveRecord or Arel Mode: Users can choose between ActiveRecord mode or Arel mode to work with the library.
  • Inline Style: Templates can be edited inline within the Ruby files.
  • Template File: Templates can also be edited in a separate HTML ERB template file.

Summary:

Super Template is a versatile library that allows users to generate SQL logic and work with reusable SQL templates. It provides easy maintenance of raw SQL logic in Ruby on Rails using plain old Ruby objects. With features like a template generator and options for ActiveRecord or Arel mode, Super Template simplifies the process of working with SQL templates in Rails applications.