File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -119,13 +119,15 @@ async def exec(
119119 For example:
120120
121121 ```Python
122- heroes = await session.execute(select(Hero)).scalars().all()
122+ result = await session.execute(select(Hero))
123+ heroes = result.scalars().all()
123124 ```
124125
125126 instead you could use `exec()`:
126127
127128 ```Python
128- heroes = await session.exec(select(Hero)).all()
129+ result = await session.exec(select(Hero))
130+ heroes = result.all()
129131 ```
130132 """
131133 )
@@ -148,13 +150,15 @@ async def execute(
148150 For example:
149151
150152 ```Python
151- heroes = await session.execute(select(Hero)).scalars().all()
153+ result = await session.execute(select(Hero))
154+ heroes = result.scalars().all()
152155 ```
153156
154157 instead you could use `exec()`:
155158
156159 ```Python
157- heroes = await session.exec(select(Hero)).all()
160+ result = await session.exec(select(Hero))
161+ heroes = result.all()
158162 ```
159163 """
160164 return await super ().execute (
You can’t perform that action at this time.
0 commit comments