Socket
Book a DemoInstallSign in
Socket

pg_decorator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg_decorator

0.0.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

PgDecorator

This gem is inspired by marginalia by 37signals but instead of patching Rails, patches Pg gem

PgDecorator adds first line of caller (tries to detect place in your code by ignoring gems, ruby and rbenv lines) as /* SQL comment */ so you could later identify "strange" or long queries in your PostgreSQL log directly.

Several reasons for creating gem:

  • marginalia did not decorate some of PostgreSQL adapter queries
  • no Rails 'dependency', you can use this gem if you use pg gem directly, or if you have non rails wrapper, such as pg_helper
  • having aggressive connection pooler in front of database server may lead to loss of "set application_name = 'newappname';",

Installation

Add this line to your application's Gemfile:

gem 'pg_decorator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pg_decorator

Usage

in your ruby script add following:

 require 'rubygems'
 require 'pg_decorator'
 PgDecorator::Injector.inject('AppToRuleWorld', '/home/ruby/world_ruler)

If you use Rails then you could create config/initializers/pg_decorator

 PgDecorator::Injector.inject(Rails.application.class.to_s.split("::").first, Rails.root.to_s)

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 25 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.