summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 14:17:08 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-10 14:17:08 -0500
commit3f9a343d725eea883aba2145de4cbb7b84f9d08c (patch)
treef55e890195c76543e689c3b939b84df15cd80a3e /lib/sqlalchemy/dialects/mysql
parenta6d54d18c1ddac30940affaa940edaad59e5d63f (diff)
downloadsqlalchemy-3f9a343d725eea883aba2145de4cbb7b84f9d08c.tar.gz
- Query.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). [ticket:1069] - select.distinct() now accepts column expressions as *args, interpreted by the Postgresql dialect as DISTINCT ON (<expr>). Note this was already available via passing a list to the `distinct` keyword argument to select(). [ticket:1069] - select.prefix_with() accepts multiple expressions (i.e. *expr), 'prefix' keyword argument to select() accepts a list or tuple. - Passing a string to the `distinct` keyword argument of `select()` for the purpose of emitting special MySQL keywords (DISTINCTROW etc.) is deprecated - use `prefix_with()` for this. - put kw arguments to select() in order - restore docs for _SelectBase, renamed from _SelectBaseMixin
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql')
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index 271218dba..21e0312f5 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -1176,6 +1176,13 @@ class MySQLCompiler(compiler.SQLCompiler):
return value
def get_select_precolumns(self, select):
+ """Add special MySQL keywords in place of DISTINCT.
+
+ .. note:: this usage is deprecated. :meth:`.Select.prefix_with`
+ should be used for special keywords at the start
+ of a SELECT.
+
+ """
if isinstance(select._distinct, basestring):
return select._distinct.upper() + " "
elif select._distinct: