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

Method test_lateral

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

Source from the content-addressed store, hash-verified

677 )
678
679 def test_lateral(self):
680 people = self.tables.people
681 values_ = (
682 values(
683 column("bookcase_id", Integer),
684 column("bookcase_owner_id", Integer),
685 name="bookcases",
686 )
687 .data([(1, 1), (2, 1), (3, 2), (3, 3)])
688 .lateral()
689 )
690 stmt = select(people, values_).select_from(
691 people.join(values_, true())
692 )
693 self.assert_compile(
694 stmt,
695 "SELECT people.people_id, people.age, people.name, "
696 "bookcases.bookcase_id, bookcases.bookcase_owner_id FROM people "
697 "JOIN LATERAL (VALUES (:param_1, :param_2), (:param_3, :param_4), "
698 "(:param_5, :param_6), (:param_7, :param_8)) AS bookcases "
699 "(bookcase_id, bookcase_owner_id) "
700 "ON true",
701 checkparams={
702 "param_1": 1,
703 "param_2": 1,
704 "param_3": 2,
705 "param_4": 1,
706 "param_5": 3,
707 "param_6": 2,
708 "param_7": 3,
709 "param_8": 3,
710 },
711 )
712
713 def test_from_linting_named(self):
714 people = self.tables.people

Callers

nothing calls this directly

Calls 9

valuesFunction · 0.90
columnFunction · 0.90
selectFunction · 0.90
trueFunction · 0.90
assert_compileMethod · 0.80
lateralMethod · 0.45
dataMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected