aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorEdgars Beigarts <ebeigarts@alise.lv>2010-01-22 22:58:31 +0200
committerJosé Valim <jose.valim@gmail.com>2010-03-26 15:54:04 +0100
commit0848c862f098d5fcaa0e11f979a4ce4a2139f6c0 (patch)
treee4693a1a16c692ec75287fa7ecea3fbd49929fbb /railties
parentb2c2b0ce459a215d389f3ab8bb9e33718460cf51 (diff)
downloadrails-0848c862f098d5fcaa0e11f979a4ce4a2139f6c0.tar.gz
rails-0848c862f098d5fcaa0e11f979a4ce4a2139f6c0.tar.bz2
rails-0848c862f098d5fcaa0e11f979a4ce4a2139f6c0.zip
Make script/dbconsole work with oracle (sqlplus <username>[/<password>][@<connect_identifier>])
[#3773 state:resolved]
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/commands/dbconsole.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 593e2d8ee3..68982b9f52 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -91,6 +91,18 @@ module Rails
args << config['database']
exec(find_cmd('sqlite3'), *args)
+
+ when "oracle", "oracle_enhanced"
+ logon = ""
+
+ if config['username']
+ logon = config['username']
+ logon << "/#{config['password']}" if config['password'] && include_password
+ logon << "@#{config['database']}" if config['database']
+ end
+
+ exec(find_cmd('sqlplus'), logon)
+
else
abort "Unknown command-line client for #{config['database']}. Submit a Rails patch to add support!"
end