Commits

Mike Bayer  committed 3780137

create_connect_args can create DSN from host/port, submitted by bernd.dorn@fhv.at for [ticket:192]

  • Participants
  • Parent commits 8963b06

Comments (0)

Files changed (1)

File lib/sqlalchemy/databases/oracle.py

         return self.module
 
     def create_connect_args(self, url):
-        opts = url.translate_connect_args([None, 'dsn', 'user', 'password'])
-        opts['threaded'] = self.threaded
+        if url.database:
+            # if we have a database, then we have a remote host
+            port = url.port or 1521
+            dsn = self.module.makedsn(url.host,port,url.database)
+        else:
+            # we have a local tnsname
+            dsn = url.host
+        opts = dict(
+            user=url.username,
+            password=url.password,
+            dsn = dsn,
+            threaded = self.threaded
+            )        
         return ([], opts)
         
     def type_descriptor(self, typeobj):