Skip to content

Commit

Permalink
Support PostgreSQL connections with no username set
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed May 28, 2008
1 parent ec417fe commit d1b88f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/db_console.rake
Expand Up @@ -24,10 +24,11 @@ namespace :db do
'--default-character-set', config["encoding"], '--default-character-set', config["encoding"],
'-D', config["database"]) '-D', config["database"])
when "postgresql" when "postgresql"
ENV['PGUSER'] = config["username"] if config["username"]
ENV['PGHOST'] = config["host"] if config["host"] ENV['PGHOST'] = config["host"] if config["host"]
ENV['PGPORT'] = config["port"].to_s if config["port"] ENV['PGPORT'] = config["port"].to_s if config["port"]
ENV['PGPASSWORD'] = config["password"].to_s if config["password"] ENV['PGPASSWORD'] = config["password"].to_s if config["password"]
system(find_cmd('psql'), '-U', config["username"], config["database"]) system(find_cmd('psql'), config["database"])
when "sqlite" when "sqlite"
system(find_cmd('sqlite'), config["database"]) system(find_cmd('sqlite'), config["database"])
when "sqlite3" when "sqlite3"
Expand Down

0 comments on commit d1b88f5

Please sign in to comment.