Sha256: 6d3b2b744d8655f979baf0ce21c1fbc1f480ec38124e23c5fff73567a49d2c62
Contents?: true
Size: 764 Bytes
Versions: 33
Compression:
Stored size: 764 Bytes
Contents
# frozen_string_literal: true require 'terminal-table' module RubyPgExtras class IndexInfoPrint def self.call(data) new.call(data) end def call(data) rows = data.map do |el| [ el.fetch(:index_name), el.fetch(:table_name), el.fetch(:columns).join(', '), el.fetch(:index_size), el.fetch(:index_scans), el.fetch(:null_frac) ] end puts Terminal::Table.new( headings: [ "Index name", "Table name", "Columns", "Index size", "Index scans", "Null frac" ], title: title, rows: rows ) end private def title "Index info" end end end
Version data entries
33 entries across 33 versions & 1 rubygems