diff options
author | Jason Kirtland <jek@discorporate.us> | 2007-08-18 18:15:11 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2007-08-18 18:15:11 +0000 |
commit | 534cf5fdbd05e2049ab9feceabf3926a5ab6380c (patch) | |
tree | d14841a65b7fb3c5173aa7ca9653c75f134b6ae8 /lib/sqlalchemy/databases | |
parent | 820346549b7e50e927c519c9bc54934e9a440422 (diff) | |
download | sqlalchemy-534cf5fdbd05e2049ab9feceabf3926a5ab6380c.tar.gz |
- fixed prefixes= argument to select()
- mysql can now generate DISTINCT or ALL for queries, select(..., distinct='ALL')
- documented 'prefixes' arg to select()
- rearranged doc order for select args to mirror that of a generated statement
- went nutty and fixed wrapping and line length on most docstrings in sql.py
Diffstat (limited to 'lib/sqlalchemy/databases')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 303a44552..d5fd3b6c5 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1752,6 +1752,14 @@ class MySQLCompiler(ansisql.ANSICompiler): # TODO: put whatever MySQL does for CAST here. return self.process(cast.clause) + def get_select_precolumns(self, select): + if isinstance(select._distinct, basestring): + return select._distinct.upper() + " " + elif select._distinct: + return "DISTINCT " + else: + return "" + def for_update_clause(self, select): if select.for_update == 'read': return ' LOCK IN SHARE MODE' |