MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get_poly_messages

Function get_poly_messages

test/typing/plain_files/orm/issue_9340.py:50–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49
50def get_poly_messages() -> Sequence[Message]:
51 with Session(engine) as session:
52 PolymorphicMessage = with_polymorphic(Message, (UserComment,))
53
54 if TYPE_CHECKING:
55 assert_type(PolymorphicMessage, AliasedClass[Message])
56
57 poly_query = select(PolymorphicMessage)
58
59 if TYPE_CHECKING:
60 assert_type(poly_query, Select[Message])
61
62 return session.scalars(poly_query).all()

Callers

nothing calls this directly

Calls 5

SessionClass · 0.90
with_polymorphicFunction · 0.90
selectFunction · 0.90
allMethod · 0.45
scalarsMethod · 0.45

Tested by

no test coverage detected