Sha256: 84e3fb2f8fcb00328221c80279aeba26f732f1038d8339880ad626b299f30afe
Contents?: true
Size: 847 Bytes
Versions: 8
Compression:
Stored size: 847 Bytes
Contents
# Supports 3.12.0+ module Skylight module Probes module Sequel class Probe def install require "sequel/database/logging" method_name = ::Sequel::Database.method_defined?(:log_connection_yield) ? "log_connection_yield" : "log_yield" mod = Module.new do define_method method_name do |sql, *args, &block| super(sql, *args) do ::ActiveSupport::Notifications.instrument( "sql.sequel", sql: sql, name: "SQL", binds: args ) do block.call end end end end ::Sequel::Database.prepend(mod) end end end register(:sequel, "Sequel", "sequel", Sequel::Probe.new) end end
Version data entries
8 entries across 8 versions & 1 rubygems