Class: Webhookdb::Postgres::Maintenance::Count
- Inherits:
-
Query
- Object
- Base
- Query
- Webhookdb::Postgres::Maintenance::Count
show all
- Defined in:
- lib/webhookdb/postgres/maintenance.rb
Instance Attribute Summary
Attributes inherited from Base
#service_integration
Instance Method Summary
collapse
Methods inherited from Query
#connstr, #fetch
Methods inherited from Base
#conn_params, #debug?, #initialize
Instance Method Details
#query ⇒ Object
127
|
# File 'lib/webhookdb/postgres/maintenance.rb', line 127
def query = "SELECT reltuples AS estimate FROM pg_class WHERE relname = '#{self.service_integration.table_name}'"
|
#run ⇒ Object
129
130
131
132
|
# File 'lib/webhookdb/postgres/maintenance.rb', line 129
def run
r = self.fetch
return r[0][:estimate].to_i
end
|
#run_fmt ⇒ Object
134
|
# File 'lib/webhookdb/postgres/maintenance.rb', line 134
def run_fmt = ActiveSupport::NumberHelper.number_to_delimited(self.run.to_i)
|