RubyGems Navigation menu

pg_sql_caller 1.0.0

PgSqlCaller is a small, focused wrapper for running raw SQL against PostgreSQL through ActiveRecord. It exposes a stable, documented API on an ActiveRecord-backed class you name, covering the queries the query builder makes awkward: single-scalar and single-column SELECTs, raw rows, ActiveRecord::Result reads, and type-cast (serialized) variants that decode PostgreSQL arrays and custom column types into Ruby objects. Every ? placeholder is bound and escaped through the ActiveRecord sanitizer, so statements stay injection-safe with no manual quoting. On top of that it adds PostgreSQL-specific helpers — non-consuming sequence peeking, table and relation sizes, EXPLAIN ANALYZE, NOTICE capture, and quoting/sanitizing utilities — plus a fast, injection-safe bulk update that partially updates many existing rows in a single UPDATE ... FROM unnest(...) statement and round-trip. The reader API is extensible via define_sql_method, and the gem runs on Ruby 3.2+ with Rails 7.1 through 8.1.

Gemfile:
=

install:
=

Versions:

  1. 1.0.0 June 08, 2026 (19.5 KB)
  2. 0.2.3 February 07, 2025 (10.5 KB)
  3. 0.2.2 February 08, 2023 (10.5 KB)
  4. 0.2.1 February 08, 2023 (10.5 KB)
  5. 0.2.0 December 23, 2020 (10.5 KB)
Show all versions (6 total)

Runtime Dependencies (2):

activerecord >= 7.1
activesupport >= 7.1

Owners:

Pushed by:

Authors:

  • Denis Talakevich

SHA 256 checksum:

=

Total downloads 44,610

For this version 348

Version Released:

License:

MIT

Required Ruby Version: >= 3.2.0

Links: