MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / go

Method go

test/orm/test_cache_key.py:1210–1232  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1208 A, B = self.classes("A", "B")
1209
1210 def go(value):
1211 with Session(testing.db) as sess:
1212 objects = sess.execute(
1213 select(A).options(
1214 loadopt(A.bs).options(
1215 with_expression(B.boolean, B.data == value)
1216 )
1217 )
1218 ).scalars()
1219 if loadopt is joinedload:
1220 objects = objects.unique()
1221 eq_(
1222 objects.all(),
1223 [
1224 A(
1225 bs=[
1226 B(data="a", boolean=value == "a"),
1227 B(data="b", boolean=value == "b"),
1228 B(data="c", boolean=value == "c"),
1229 ]
1230 )
1231 ],
1232 )
1233
1234 go("b")
1235 go("c")

Callers

nothing calls this directly

Calls 11

SessionClass · 0.90
selectFunction · 0.90
with_expressionFunction · 0.90
eq_Function · 0.90
AClass · 0.70
BClass · 0.70
scalarsMethod · 0.45
executeMethod · 0.45
optionsMethod · 0.45
uniqueMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected