Top Level Namespace

Defined Under Namespace

Modules: RailsPgExtras Classes: DiagnoseTool, MissingFkConstraintsTool, MissingFkIndexesTool, ReadmeResource

Constant Summary collapse

SKIP_QUERIES =
i[
  add_extensions
  pg_stat_statements_reset
  kill_pid
  kill_all
  mandelbrot
]
QUERY_TOOL_CLASSES =
RubyPgExtras::QUERIES.reject { |q| SKIP_QUERIES.include?(q) }.map do |query_name|
  Class.new(FastMcp::Tool) do
    description RubyPgExtras.description_for(query_name: query_name)

    define_method :call do
      RailsPgExtras.public_send(query_name, in_format: :hash)
    end

    define_singleton_method :name do
      query_name.to_s
    end
  end
end