Skip to content

Commit a73439a

Browse files
authored
fix(crud): Use subqueryload for all joins (#920)
1 parent 712c9ea commit a73439a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openadapt/db/crud.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
from openadapt.db.db import Session, get_read_only_session_maker
2121
from openadapt.models import (
2222
ActionEvent,
23-
BrowserEvent,
2423
AudioInfo,
24+
BrowserEvent,
2525
MemoryStat,
2626
PerformanceStat,
2727
Recording,
@@ -573,8 +573,8 @@ def get_screenshots(
573573
session.query(Screenshot)
574574
.filter(Screenshot.recording_id == recording.id)
575575
.options(
576-
joinedload(Screenshot.action_event).joinedload(ActionEvent.recording),
577-
subqueryload(Screenshot.action_event).joinedload(ActionEvent.screenshot),
576+
subqueryload(Screenshot.action_event).subqueryload(ActionEvent.recording),
577+
subqueryload(Screenshot.action_event).subqueryload(ActionEvent.screenshot),
578578
subqueryload(Screenshot.recording),
579579
)
580580
.order_by(Screenshot.timestamp)

0 commit comments

Comments
 (0)