]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
doc for oracle fix
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Jun 2006 23:11:06 +0000 (23:11 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Jun 2006 23:11:06 +0000 (23:11 +0000)
CHANGES
doc/build/content/dbengine.txt
lib/sqlalchemy/databases/oracle.py

diff --git a/CHANGES b/CHANGES
index 331348b30383e8cfcdb95be83716fa047c142d61..6b196f44025e461a379c5975815972b5a12496c1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,7 +9,9 @@ with threadlocal strategy (its totally safe !)
 - create_engine() can take URLs as string or unicode [ticket:188]
 - firebird support partially completed; 
 thanks to James Ralston and Brad Clements for their efforts.
-- Oracle url translation was broken, fixed
+- Oracle url translation was broken, fixed, will feed host/port/sid
+into cx_oracle makedsn() if 'database' field is present, else uses 
+straight TNS name from the 'host' field
 - fix to using unicode criterion for query.get()/query.load()
 - count() function on selectables now uses table primary key or 
 first column instead of "1" for criterion, also uses label "rowcount"
index 715e274fad008b6137869b4d59effdf98cc5a224..a83da7310263447391a180f3f7313e93c49cf417 100644 (file)
@@ -34,8 +34,13 @@ Available drivernames are `sqlite`, `mysql`, `postgres`, `oracle`, `mssql`, and
     pg_db = create_engine('postgres://scott:tiger@localhost:5432/mydatabase')
     sqlite_db = create_engine('sqlite:///mydb.txt')
     mysql_db = create_engine('mysql://localhost/foo')
+
+    # oracle via TNS name
     oracle_db = create_engine('oracle://scott:tiger@dsn')
 
+    # oracle will feed host/port/SID into cx_oracle.makedsn
+    oracle_db = create_engine('oracle://scott:tiger@127.0.0.1:1521/sidname')
+
 The `Engine` will create its first connection to the database when a SQL statement is executed.  As concurrent statements are executed, the underlying connection pool will grow to a default size of five connections, and will allow a default "overflow" of ten.   Since the `Engine` is essentially "home base" for the connection pool, it follows that you should keep a single `Engine` per database established within an application, rather than creating a new one for each connection.
 
 ### Database Engine Options {@name=options}
index f6a819ebbf2b41c847c95ee86f786409804988f9..167059ed20f4d9d8a2196c9e9dcba05571568cc1 100644 (file)
@@ -133,7 +133,7 @@ class OracleDialect(ansisql.ANSIDialect):
             dsn = self.module.makedsn(url.host,port,url.database)
         else:
             # we have a local tnsname
-           dsn = url.host
+            dsn = url.host
         opts = dict(
             user=url.username,
             password=url.password,