summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-19 16:21:33 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-19 16:21:33 +0000
commit2f9bc2c338ce45b5d24cd0a795c4f801435fcbb4 (patch)
tree87dbb93eee1cd51c69849a3d803ce161b04e5fa9
parentb5888d8fec57487444808e5835bbd87e4fe5dee6 (diff)
downloadsqlalchemy-2f9bc2c338ce45b5d24cd0a795c4f801435fcbb4.tar.gz
added distinct() function to column elements for "DISTINCT <col>"
-rw-r--r--CHANGES1
-rw-r--r--lib/sqlalchemy/sql.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 8810b1db1..8995de9d3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@
blown away if it hadnt been loaded
- added unique_connection() method to engine, connection pool to return a connection
that is not part of the thread-local context or any current transaction
+- added distinct() function to column elements so you can do func.count(mycol.distinct())
0.1.4
- create_engine() now uses genericized parameters; host/hostname, db/dbname/database,
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index f78d4fa73..b88cf18cd 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -490,6 +490,8 @@ class CompareMixin(object):
return self._compare('LIKE', "%" + str(other))
def label(self, name):
return Label(name, self)
+ def distinct(self):
+ return CompoundClause(None,"DISTNCT", self)
def op(self, operator):
return lambda other: self._compare(operator, other)
# and here come the math operators: