MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_with_standalone_aliased_join

Method test_with_standalone_aliased_join

test/sql/test_values.py:646–677  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

644 )
645
646 def test_with_standalone_aliased_join(self):
647 people = self.tables.people
648 values_ = values(
649 column("bookcase_id", Integer),
650 column("bookcase_owner_id", Integer),
651 ).data([(1, 1), (2, 1), (3, 2), (3, 3)])
652 values_ = alias(values_, "bookcases")
653
654 stmt = select(people, values_).select_from(
655 people.join(
656 values_, values_.c.bookcase_owner_id == people.c.people_id
657 )
658 )
659 self.assert_compile(
660 stmt,
661 "SELECT people.people_id, people.age, people.name, "
662 "bookcases.bookcase_id, bookcases.bookcase_owner_id FROM people "
663 "JOIN (VALUES (:param_1, :param_2), (:param_3, :param_4), "
664 "(:param_5, :param_6), (:param_7, :param_8)) AS bookcases "
665 "(bookcase_id, bookcase_owner_id) "
666 "ON people.people_id = bookcases.bookcase_owner_id",
667 checkparams={
668 "param_1": 1,
669 "param_2": 1,
670 "param_3": 2,
671 "param_4": 1,
672 "param_5": 3,
673 "param_6": 2,
674 "param_7": 3,
675 "param_8": 3,
676 },
677 )
678
679 def test_lateral(self):
680 people = self.tables.people

Callers

nothing calls this directly

Calls 8

valuesFunction · 0.90
columnFunction · 0.90
aliasFunction · 0.90
selectFunction · 0.90
assert_compileMethod · 0.80
dataMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected