Sha256: 73a907a019616640f084be0ce06bbdf98fe6d33a2a8b1192a09282eb36573d4f
Contents?: true
Size: 767 Bytes
Versions: 10
Compression:
Stored size: 767 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
10 entries across 10 versions & 1 rubygems