code stringlengths 3 6.57k |
|---|
fixture_session() |
sess.query(User) |
join(Address, "addresses") |
test_no_strings_for_dual_onclause_newstyle(self) |
select(User) |
join(Address, "addresses") |
test_select_from(self) |
select_from() |
fixture_session() |
sess.query(Item.id) |
select_from(User) |
join(User.orders) |
join(Order.items) |
sess.query(Item.id) |
select_from(User) |
join(Item, User.id == Item.id) |
JoinFromSelectableTest(fixtures.MappedTest, AssertsCompiledSQL) |
define_tables(cls, metadata) |
Table("table1", metadata, Column("id", Integer, primary_key=True) |
Column("id", Integer, primary_key=True) |
Column("t1_id", Integer) |
setup_classes(cls) |
T1(cls.Comparable) |
T2(cls.Comparable) |
setup_mappers(cls) |
cls.classes("T1", "T2") |
cls.mapper_registry.map_imperatively(T1, table1) |
cls.mapper_registry.map_imperatively(T2, table2) |
test_select_mapped_to_mapped_explicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(subq.c.count, T1.id) |
select_from(subq) |
join(T1, subq.c.t1_id == T1.id) |
count(table2.id) |
test_select_mapped_to_mapped_implicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(subq.c.count, T1.id) |
join(T1, subq.c.t1_id == T1.id) |
count(table2.id) |
test_select_mapped_to_select_explicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(subq.c.count, T1.id) |
select_from(T1) |
join(subq, subq.c.t1_id == T1.id) |
count(table2.id) |
test_select_mapped_to_select_implicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(subq.c.count, T1.id) |
join(subq, subq.c.t1_id == T1.id) |
count(table2.id) |
sess.query(subq.c.count, T1.id) |
select_from(T1) |
join(subq, subq.c.t1_id == T1.id) |
count(table2.id) |
test_mapped_select_to_mapped_implicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(T1.id, subq.c.count) |
join(T1, subq.c.t1_id == T1.id) |
FROM (SELECT table2.t1_id AS t1_id, count(table2.id) |
sess.query(T1.id, subq.c.count) |
select_from(subq) |
join(T1, subq.c.t1_id == T1.id) |
FROM (SELECT table2.t1_id AS t1_id, count(table2.id) |
test_mapped_select_to_mapped_explicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(T1.id, subq.c.count) |
select_from(subq) |
join(T1, subq.c.t1_id == T1.id) |
FROM (SELECT table2.t1_id AS t1_id, count(table2.id) |
test_mapped_select_to_select_explicit_left(self) |
fixture_session() |
sess.query(T2.t1_id, func.count(T2.id) |
label("count") |
group_by(T2.t1_id) |
subquery() |
sess.query(T1.id, subq.c.count) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.