module ROM::Plugins::Relation::SQL::Instrumentation
Instrumentation
for relations and commands
This plugin allows configuring a notification system, that will be used to instrument interactions with databases, it's based on an abstract API so it should work with any instrumentation object that provides `instrument(identifier, payload)` method.
By default, instrumentation is triggered with following arguments:
- `identifier` is set to `:sql` - `payload` is set to a hash with following keys: - `:name` database type, ie `:sqlite`, `:postgresql` etc. - `:query` a string with an SQL statement that was executed
@example configuring notifications
config = ROM::Configuration.new(:sqlite, 'sqlite::memory') config.plugin(:sql, relations: :instrumentation) do |c| c.notifications = MyNotifications.new end
@api public
Public Class Methods
included(klass)
click to toggle source
Add `:notifications` option to a relation
@api private
Calls superclass method
# File lib/rom/plugins/relation/sql/instrumentation.rb, line 82 def self.included(klass) super klass.option :notifications end