Skip to content

Commit

Permalink
Merge branch 'main' of github.com-toluaina:toluaina/pgsync into main
Browse files Browse the repository at this point in the history
  • Loading branch information
toluaina committed Dec 27, 2022
2 parents 0e8a027 + fea9a7e commit 4e94569
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pgsync/querybuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,16 @@ def _non_through(self, node: Node) -> None: # noqa: C901
onclause: list = []

foreign_keys: dict = self._get_foreign_keys(node, child)

table: Optional[str] = (
child.relationship.throughs[0].table
if child.relationship.throughs
else None
)
foreign_key_columns: list = self._get_column_foreign_keys(
child._subquery.columns,
foreign_keys,
table=table,
schema=child.schema,
)

for i in range(len(foreign_key_columns)):
Expand Down

0 comments on commit 4e94569

Please sign in to comment.