0.0
The project is in a healthy, maintained state
Auto-patches ActiveRecord's PostgreSQL adapter to route queries through the Gold Lapel proxy. Zero config — just add the gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

goldlapel-rails

Rails integration for Gold Lapel — the self-optimizing Postgres proxy.

Auto-patches ActiveRecord's PostgreSQL adapter to start the Gold Lapel proxy on first connection and route all queries through it. Zero config — just add the gem.

Installation

# Gemfile
gem "goldlapel-rails"

That's it. Your existing config/database.yml works unchanged.

How It Works

When ActiveRecord opens its first PostgreSQL connection, goldlapel-rails:

  1. Reads your connection params (host, port, user, password, database)
  2. Starts the Gold Lapel proxy pointing at your database
  3. Rewrites the connection to go through the proxy (127.0.0.1:7932)

On reconnect, the proxy is already running — the adapter reuses the rewritten params.

Optional Configuration

You can pass Gold Lapel options in config/database.yml:

production:
  adapter: postgresql
  host: db.example.com
  database: mydb
  username: user
  password: pass
  goldlapel:
    port: 9000                          # proxy listen port (default: 7932)
    config:                             # proxy configuration
      mode: butler
      pool_size: 30
      disable_n1: true
    extra_args:
      - "--threshold-duration-ms"
      - "200"

The config hash maps directly to Gold Lapel's configuration options. Use snake_case keys:

# config/environments/production.rb (programmatic alternative)
config.database_configuration["production"]["goldlapel"] = {
  config: { mode: "butler", pool_size: 30, disable_n1: true }
}

Multiple Databases

Each database needs a different proxy port:

production:
  primary:
    adapter: postgresql
    host: primary-db.example.com
    database: myapp
    goldlapel:
      port: 7932

  analytics:
    adapter: postgresql
    host: analytics-db.example.com
    database: analytics
    goldlapel:
      port: 7933

Requirements

  • Ruby >= 3.2
  • Rails >= 7.0
  • The goldlapel gem (added automatically as a dependency)

License

Proprietary. See goldlapel.com for licensing.