diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-13 00:24:54 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-13 00:24:54 +0000 |
commit | c5e1abc7f7adce841775ea92b72bcf95207027af (patch) | |
tree | b406fd4e6ede57ed8805a40a909c3c69207d3414 /lib/sqlalchemy/ansisql.py | |
parent | 2ce45d70c7e499fd6c239d963f50cd839b28629b (diff) | |
download | sqlalchemy-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/ansisql.py')
-rw-r--r-- | lib/sqlalchemy/ansisql.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py index 7f95cd392..b039b346b 100644 --- a/lib/sqlalchemy/ansisql.py +++ b/lib/sqlalchemy/ansisql.py @@ -118,7 +118,8 @@ class ANSICompiler(sql.Compiled): objects compiled within this object. The output is dependent on the paramstyle of the DBAPI being used; if a named style, the return result will be a dictionary with keynames matching the compiled statement. If a positional style, the output - will be a list corresponding to the bind positions in the compiled statement. + will be a list, with an iterator that will return parameter + values in an order corresponding to the bind positions in the compiled statement. for an executemany style of call, this method should be called for each element in the list of parameter groups that will ultimately be executed. @@ -129,32 +130,23 @@ class ANSICompiler(sql.Compiled): bindparams = {} bindparams.update(params) + d = sql.ClauseParameters(self.engine) if self.positional: - d = OrderedDict() for k in self.positiontup: b = self.binds[k] - if self.engine is not None: - d[k] = b.typeprocess(b.value, self.engine) - else: - d[k] = b.value + d.set_parameter(k, b.value, b) else: - d = {} for b in self.binds.values(): - if self.engine is not None: - d[b.key] = b.typeprocess(b.value, self.engine) - else: - d[b.key] = b.value + d.set_parameter(b.key, b.value, b) for key, value in bindparams.iteritems(): try: b = self.binds[key] except KeyError: continue - if self.engine is not None: - d[b.key] = b.typeprocess(value, self.engine) - else: - d[b.key] = value + d.set_parameter(b.key, value, b) + #print "FROM", params, "TO", d return d def get_named_params(self, parameters): |