diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-12-01 17:24:27 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-24 11:54:08 -0400 |
| commit | dce8c7a125cb99fad62c76cd145752d5afefae36 (patch) | |
| tree | 352dfa2c38005207ca64f45170bbba2c0f8c927e /test/sql/test_compiler.py | |
| parent | 1502b5b3e4e4b93021eb927a6623f288ef006ba6 (diff) | |
| download | sqlalchemy-dce8c7a125cb99fad62c76cd145752d5afefae36.tar.gz | |
Unify Query and select() , move all processing to compile phase
Convert Query to do virtually all compile state computation
in the _compile_context() phase, and organize it all
such that a plain select() construct may also be used as the
source of information in order to generate ORM query state.
This makes it such that Query is not needed except for
its additional methods like from_self() which are all to
be deprecated.
The construction of ORM state will occur beyond the
caching boundary when the new execution model is integrated.
future select() gains a working join() and filter_by() method.
as we continue to rebase and merge each commit in the steps,
callcounts continue to bump around. will have to look at
the final result when it's all in.
References: #5159
References: #4705
References: #4639
References: #4871
References: #5010
Change-Id: I19e05b3424b07114cce6c439b05198ac47f7ac10
Diffstat (limited to 'test/sql/test_compiler.py')
| -rw-r--r-- | test/sql/test_compiler.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index b3ae7e12d..c580e972d 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -29,6 +29,7 @@ from sqlalchemy import exc from sqlalchemy import except_ from sqlalchemy import exists from sqlalchemy import Float +from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import intersect @@ -85,7 +86,6 @@ from sqlalchemy.testing import fixtures from sqlalchemy.testing import is_ from sqlalchemy.util import u - table1 = table( "mytable", column("myid", Integer), @@ -123,6 +123,13 @@ table5 = Table( schema="dbo.remote_owner", ) +parent = Table("parent", metadata, Column("id", Integer, primary_key=True)) +child = Table( + "child", + metadata, + Column("id", Integer, primary_key=True), + Column("parent_id", ForeignKey("parent.id")), +) users = table( "users", column("user_id"), column("user_name"), column("password") ) @@ -5218,7 +5225,14 @@ class ResultMapTest(fixtures.TestBase): eq_(len(stmt.subquery().c), 7) # will render 7 as well - eq_(len(stmt._compile_state_factory(stmt, None).columns_plus_names), 7) + eq_( + len( + stmt._compile_state_factory( + stmt, stmt.compile() + ).columns_plus_names + ), + 7, + ) wrapped = stmt._generate() wrapped = wrapped.add_columns( |
