Permalink
Browse files

pull DATABASE_URL via config_vars

This is considerably faster, particularly if your app is not currently
spun up.
  • Loading branch information...
1 parent aa5c1ee commit df654d5bc0ff84a3dd5648bfe8b002318533ce45 @wuputah committed with hone Mar 5, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/heroku/commands/sql.rb
@@ -2,10 +2,10 @@ class Heroku::Command::Sql < Heroku::Command::Base
def index
app = extract_app
- database_url = heroku.console(app, "puts ENV['DATABASE_URL']")
+ database_url = heroku.config_vars(app)['DATABASE_URL']
sqlconsole_history_read(app)
-
+
display "SQL console for #{app}.#{heroku.host}"
while sql = Readline.readline('SQL> ')
unless sql.nil? || sql.strip.empty?

0 comments on commit df654d5

Please sign in to comment.