diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-25 03:28:49 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-25 03:28:49 +0000 |
commit | cf18eecd704f5eb6fde4e0c362cfdb322e3e559a (patch) | |
tree | 9b6e4503802cf0fcae9171b3ac2f85ba0af453c7 /lib/sqlalchemy/databases/mysql.py | |
parent | 6f604f911640d92f705fc6611bfaa3e2600c4ee1 (diff) | |
download | sqlalchemy-cf18eecd704f5eb6fde4e0c362cfdb322e3e559a.tar.gz |
- named_with_column becomes an attribute
- cleanup within compiler visit_select(), column labeling
- is_select() removed from dialects, replaced with returns_rows_text(), returns_rows_compiled()
- should_autocommit() removed from dialects, replaced with should_autocommit_text() and
should_autocommit_compiled()
- typemap and column_labels collections removed from Compiler, replaced with single "result_map" collection.
- ResultProxy uses more succinct logic in combination with result_map to target columns
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 39bfc0bea..03b9a749c 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1378,9 +1378,6 @@ def descriptor(): class MySQLExecutionContext(default.DefaultExecutionContext): - _my_is_select = re.compile(r'\s*(?:SELECT|SHOW|DESCRIBE|XA +RECOVER)', - re.I | re.UNICODE) - def post_exec(self): if self.compiled.isinsert and not self.executemany: if (not len(self._last_inserted_ids) or @@ -1388,11 +1385,11 @@ class MySQLExecutionContext(default.DefaultExecutionContext): self._last_inserted_ids = ([self.cursor.lastrowid] + self._last_inserted_ids[1:]) - def is_select(self): - return SELECT_RE.match(self.statement) + def returns_rows_text(self, statement): + return SELECT_RE.match(statement) - def should_autocommit(self): - return AUTOCOMMIT_RE.match(self.statement) + def should_autocommit_text(self, statement): + return AUTOCOMMIT_RE.match(statement) class MySQLDialect(default.DefaultDialect): @@ -1873,9 +1870,6 @@ class MySQLCompiler(compiler.DefaultCompiler): if type_ is None: return self.process(cast.clause) - if self.stack and self.stack[-1].get('select'): - # not sure if we want to set the typemap here... - self.typemap.setdefault("CAST", cast.type) return 'CAST(%s AS %s)' % (self.process(cast.clause), type_) |