pawurb/rails-pg-extras

postgres durations should be humanized

ChrisCPO opened this issue · 1 comments

it would be nice if Postgres durations were parsed in the view, to show a human-readable format. Like on the Outliers query.

perhaps via
https://api.rubyonrails.org/classes/ActiveSupport/Duration.html#method-c-parse

[1] pry(main)> ActiveSupport::Duration.parse("PT33H55M39.757252S")
=> 33 hours, 55 minutes, and 39.757252 seconds
pawurb commented

Hi. I prefer to keep the duration outputs raw for simpler parsing via scripts. Also I've noticed that depending on PG version durations have different formats so it might be difficult to offer single parsing that always works.