Skip to content
Browse files

Make script/dbconsole work with oracle (sqlplus <username>[/<password…

…>][@<connect_identifier>])

[#3773 state:resolved]
  • Loading branch information...
1 parent b2c2b0c commit 0848c862f098d5fcaa0e11f979a4ce4a2139f6c0 Edgars Beigarts committed with josevalim
Showing with 12 additions and 0 deletions.
  1. +12 −0 railties/lib/rails/commands/dbconsole.rb
View
12 railties/lib/rails/commands/dbconsole.rb
@@ -91,6 +91,18 @@ def find_cmd(*commands)
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

0 comments on commit 0848c86

Please sign in to comment.
Something went wrong with that request. Please try again.