Commits

Mike Bayer  committed 63f33c5

- some ordering fixes on DISTINCT for PG 8.4, mysql
- forwards compat "postgresql" name available for --db, engine urls

  • Participants
  • Parent commits 42054e4
  • Branches rel_0_5
  • Tags rel_0_5_6

Comments (0)

Files changed (6)

       dict for "info" argument would raise an exception.
       [ticket:1482]
 
+- postgresql
+    - The driver can be specified as "postgresql://" in URLs,
+      allowing forwards-compatibility with 0.6.
+      
 - oracle
     - Backported 0.6 fix for Oracle alias names not getting
       truncated.  [ticket:1309]

File lib/sqlalchemy/databases/postgresql.py

+"""Provide forwards compatibility with SQLAlchemy 0.6 which 
+uses the name "postgresql" for the Postgresql dialect.
+
+"""
+from sqlalchemy.databases.postgres import dialect

File lib/sqlalchemy/test/config.py

 sqlite=sqlite:///:memory:
 sqlite_file=sqlite:///querytest.db
 postgres=postgres://scott:tiger@127.0.0.1:5432/test
+postgresql=postgres://scott:tiger@127.0.0.1:5432/test
 mysql=mysql://scott:tiger@127.0.0.1:3306/test
 oracle=oracle://scott:tiger@127.0.0.1:1521
 oracle8=oracle://scott:tiger@127.0.0.1:1521/?use_ansi=0

File test/orm/test_eager_relations.py

         s = sa.union_all(u2.select(use_labels=True), u2.select(use_labels=True), u2.select(use_labels=True)).alias('u')
 
         mapper(User, users, properties={
-            'addresses':relation(mapper(Address, addresses), lazy=False),
+            'addresses':relation(mapper(Address, addresses), lazy=False, order_by=addresses.c.id),
         })
 
         sess = create_session()
         q = sess.query(User)
 
         def go():
-            l = q.filter(s.c.u2_id==User.id).distinct().all()
-            assert self.static.user_address_result == l
+            l = q.filter(s.c.u2_id==User.id).distinct().order_by(User.id).all()
+            eq_(self.static.user_address_result, l)
         self.assert_sql_count(testing.db, go, 1)
 
     @testing.fails_on('maxdb', 'FIXME: unknown')

File test/orm/test_lazy_relations.py

         u2 = users.alias('u2')
         s = sa.union_all(u2.select(use_labels=True), u2.select(use_labels=True), u2.select(use_labels=True)).alias('u')
         print [key for key in s.c.keys()]
-        l = q.filter(s.c.u2_id==User.id).distinct().all()
-        assert self.static.user_all_result == l
+        l = q.filter(s.c.u2_id==User.id).distinct().order_by(User.id).all()
+        eq_(self.static.user_all_result, l)
 
     @testing.resolve_artifact_names
     def test_one_to_many_scalar(self):

File test/orm/test_query.py

         
 class DistinctTest(QueryTest):
     def test_basic(self):
-        assert [User(id=7), User(id=8), User(id=9),User(id=10)] == create_session().query(User).distinct().all()
+        assert [User(id=7), User(id=8), User(id=9),User(id=10)] == create_session().query(User).distinct().order_by(User.id).all()
         assert [User(id=7), User(id=9), User(id=8),User(id=10)] == create_session().query(User).distinct().order_by(desc(User.name)).all()
 
     def test_joined(self):