Skip to content

Commit

Permalink
pull DATABASE_URL via config_vars
Browse files Browse the repository at this point in the history
This is considerably faster, particularly if your app is not currently
spun up.
  • Loading branch information
wuputah authored and hone committed Mar 5, 2011
1 parent aa5c1ee commit df654d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/heroku/commands/sql.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ class Heroku::Command::Sql < Heroku::Command::Base


def index def index
app = extract_app app = extract_app
database_url = heroku.console(app, "puts ENV['DATABASE_URL']") database_url = heroku.config_vars(app)['DATABASE_URL']


sqlconsole_history_read(app) sqlconsole_history_read(app)

display "SQL console for #{app}.#{heroku.host}" display "SQL console for #{app}.#{heroku.host}"
while sql = Readline.readline('SQL> ') while sql = Readline.readline('SQL> ')
unless sql.nil? || sql.strip.empty? unless sql.nil? || sql.strip.empty?
Expand Down

0 comments on commit df654d5

Please sign in to comment.