Sha256: cd5c39302b5aa3c9592baa2d8ef1eb5c23d9407a3a0d7429bb23be54bcb80838
Contents?: true
Size: 866 Bytes
Versions: 33
Compression:
Stored size: 866 Bytes
Contents
# frozen_string_literal: true require 'terminal-table' module RubyPgExtras class TableInfoPrint def self.call(data) new.call(data) end def call(data) rows = data.map do |el| [ el.fetch(:table_name), el.fetch(:table_size), el.fetch(:table_cache_hit), el.fetch(:indexes_cache_hit), el.fetch(:estimated_rows), el.fetch(:sequential_scans), el.fetch(:indexes_scans) ] end puts Terminal::Table.new( headings: [ "Table name", "Table size", "Table cache hit", "Indexes cache hit", "Estimated rows", "Sequential scans", "Indexes scans" ], title: title, rows: rows ) end private def title "Table info" end end end
Version data entries
33 entries across 33 versions & 1 rubygems