From ff64be5e05a404752031f20fe4a3f7182867de62 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 2 Jun 2006 23:11:06 +0000 Subject: [PATCH] doc for oracle fix --- CHANGES | 4 +++- doc/build/content/dbengine.txt | 5 +++++ lib/sqlalchemy/databases/oracle.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 331348b303..6b196f4402 100644 --- 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" diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index 715e274fad..a83da73102 100644 --- a/doc/build/content/dbengine.txt +++ b/doc/build/content/dbengine.txt @@ -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} diff --git a/lib/sqlalchemy/databases/oracle.py b/lib/sqlalchemy/databases/oracle.py index f6a819ebbf..167059ed20 100644 --- a/lib/sqlalchemy/databases/oracle.py +++ b/lib/sqlalchemy/databases/oracle.py @@ -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, -- 2.47.2