diff options
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/elements.py | 8 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/operators.py | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index a450efaf0..1f8129382 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -41,12 +41,18 @@ def collate(expression, collation): mycolumn COLLATE utf8_bin + The collation expression is also quoted if it is a case sensitive + identifer, e.g. contains uppercase characters. + + .. versionchanged:: 1.2 quoting is automatically applied to COLLATE + expressions if they are case sensitive. + """ expr = _literal_as_binds(expression) return BinaryExpression( expr, - _literal_as_text(collation), + ColumnClause(collation), operators.collate, type_=expr.type) diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 8f697b27e..49642acdd 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -695,7 +695,13 @@ class ColumnOperators(Operators): def collate(self, collation): """Produce a :func:`~.expression.collate` clause against - the parent object, given the collation string.""" + the parent object, given the collation string. + + .. seealso:: + + :func:`~.expression.collate` + + """ return self.operate(collate, collation) def __radd__(self, other): |
