diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-06-02 23:11:06 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-06-02 23:11:06 +0000 |
| commit | ff64be5e05a404752031f20fe4a3f7182867de62 (patch) | |
| tree | 01f6e6827814f0edfb94d8264d29f95a7fff8ded | |
| parent | 4bbbe40dadc7357c54f60c293e1b324e4330803e (diff) | |
| download | sqlalchemy-ff64be5e05a404752031f20fe4a3f7182867de62.tar.gz | |
doc for oracle fix
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | doc/build/content/dbengine.txt | 5 | ||||
| -rw-r--r-- | lib/sqlalchemy/databases/oracle.py | 2 |
3 files changed, 9 insertions, 2 deletions
@@ -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 715e274fa..a83da7310 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 f6a819ebb..167059ed2 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, |
