summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 00:24:54 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 00:24:54 +0000
commitc5e1abc7f7adce841775ea92b72bcf95207027af (patch)
treeb406fd4e6ede57ed8805a40a909c3c69207d3414 /lib/sqlalchemy/engine.py
parent2ce45d70c7e499fd6c239d963f50cd839b28629b (diff)
downloadsqlalchemy-c5e1abc7f7adce841775ea92b72bcf95207027af.tar.gz
refactor to Compiled.get_params() to return new ClauseParameters object, a more intelligent bind parameter dictionary that does type conversions late and preserves the unconverted value; used to fix mappers not comparing correct value in post-fetch [ticket:110]
removed pre_exec assertion from oracle/firebird regarding "check for sequence/primary key value" fix to Unicode type to check for null, fixes [ticket:109] create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections fix to select([func(column)]) so that it creates a FROM clause to the column's table, fixes [ticket:111] doc updates for column defaults, indexes, connection pooling, engine params unit tests for the above bugfixes
Diffstat (limited to 'lib/sqlalchemy/engine.py')
-rw-r--r--lib/sqlalchemy/engine.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine.py b/lib/sqlalchemy/engine.py
index 269402f81..e44e0a950 100644
--- a/lib/sqlalchemy/engine.py
+++ b/lib/sqlalchemy/engine.py
@@ -203,6 +203,25 @@ class SQLEngine(schema.SchemaEngine):
self._figure_paramstyle()
self.logger = logger or util.Logger(origin='engine')
+ def _translate_connect_args(self, names, args):
+ """translates a dictionary of connection arguments to those used by a specific dbapi.
+ the names parameter is a tuple of argument names in the form ('host', 'database', 'user', 'password')
+ where the given strings match the corresponding argument names for the dbapi. Will return a dictionary
+ with the dbapi-specific parameters, the generic ones removed, and any additional parameters still remaining,
+ from the dictionary represented by args. Will return a blank dictionary if args is null."""
+ if args is None:
+ return {}
+ a = args.copy()
+ standard_names = [('host','hostname'), ('database', 'dbname'), ('user', 'username'), ('password', 'passwd', 'pw')]
+ for n in names:
+ sname = standard_names.pop(0)
+ if n is None:
+ continue
+ for sn in sname:
+ if sn != n and a.has_key(sn):
+ a[n] = a[sn]
+ del a[sn]
+ return a
def _get_ischema(self):
# We use a property for ischema so that the accessor
# creation only happens as needed, since otherwise we
@@ -563,7 +582,6 @@ class SQLEngine(schema.SchemaEngine):
parameters = [compiled.get_params(**m) for m in parameters]
else:
parameters = compiled.get_params(**parameters)
-
def proxy(statement=None, parameters=None):
if statement is None:
return cursor