summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/default.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-03-28 07:19:14 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-03-28 07:19:14 +0000
commite0b638a704f7f0abf88d1a80a95cf052954e048c (patch)
tree6b8717e491820322c48b5b271ec6b192fa8a86cd /lib/sqlalchemy/engine/default.py
parentccbcbda43e74a1d09d50aa2f8212b3cb9adafd23 (diff)
downloadsqlalchemy-e0b638a704f7f0abf88d1a80a95cf052954e048c.tar.gz
- column label and bind param "truncation" also generate
deterministic names now, based on their ordering within the full statement being compiled. this means the same statement will produce the same string across application restarts and allowing DB query plan caching to work better. - cleanup to sql.ClauseParameters since it was just falling apart, API made more explicit - many unit test tweaks to adjust for bind params not being "pre" truncated, changes to ClauseParameters
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
-rw-r--r--lib/sqlalchemy/engine/default.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 798d02d32..e9ea6c149 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -255,20 +255,20 @@ class DefaultExecutionContext(base.ExecutionContext):
# its a pk, add the value to our last_inserted_ids list,
# or, if its a SQL-side default, dont do any of that, but we'll need
# the SQL-generated value after execution.
- elif not param.has_key(c.key) or param[c.key] is None:
+ elif not c.key in param or param.get_original(c.key) is None:
if isinstance(c.default, schema.PassiveDefault):
self._lastrow_has_defaults = True
newid = drunner.get_column_default(c)
if newid is not None:
- param[c.key] = newid
+ param.set_value(c.key, newid)
if c.primary_key:
- last_inserted_ids.append(param[c.key])
+ last_inserted_ids.append(param.get_processed(c.key))
elif c.primary_key:
need_lastrowid = True
# its an explicitly passed pk value - add it to
# our last_inserted_ids list.
elif c.primary_key:
- last_inserted_ids.append(param[c.key])
+ last_inserted_ids.append(param.get_processed(c.key))
if need_lastrowid:
self._last_inserted_ids = None
else:
@@ -290,8 +290,8 @@ class DefaultExecutionContext(base.ExecutionContext):
pass
# its not in the bind parameters, and theres an "onupdate" defined for the column;
# execute it and add to bind params
- elif c.onupdate is not None and (not param.has_key(c.key) or param[c.key] is None):
+ elif c.onupdate is not None and (not c.key in param or param.get_original(c.key) is None):
value = drunner.get_column_onupdate(c)
if value is not None:
- param[c.key] = value
+ param.set_value(c.key, value)
self._last_updated_params = param