Use the connection reset endpoint

This can let users kill connections even if they're out of connections. Maintains old behavior on hobby tier for the moment.
I don't think there Is unshift. You can peek I think with "args"

On Monday, June 16, 2014, Maciek Sakrejda <notifications@github.com> wrote:

> In lib/heroku/command/pg.rb:
>
> > @@ -706,6 +706,27 @@ def calls
> >      puts exec_sql(sql)
> >    end
> >
> > +  alias_method :orig_killall, :killall
> > +  # pg:killall [DATABASE]
> > +  #
> > +  # terminates ALL connection
> > +  #
> > +  def killall
> > +    db = shift_argument
> > +    attachment = generate_resolver.resolve(db, "DATABASE_URL")
> > +    validate_arguments!
> > +
> > +    if attachment.starter_plan?
> > +      # Yobuko does not support this endpoint yet
> > +      return orig_killall
>
> Actually, I don't think this will work because we've already shifted the
> db argument, right? Is there an unshift_argument or something in the
> helpers? I wanted to fall back to the original method definition when the
> remote call fails as well.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/heroku/heroku-pg-extras/pull/87/files#r13819312>.
>