Sha256: dc5b438cc40c3ac53197a8bec531c349d2c051ee8f4719e3e1b946c929851297
Contents?: true
Size: 764 Bytes
Versions: 9
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
9 entries across 9 versions & 1 rubygems