Skip to content

Support for polymorphic o2m/m2m relations (INNER_JOIN ... AND ...) #480

Answered by trevlt
phlisg asked this question in Q&A
Discussion options

You must be logged in to vote

Do you mean AND in the join condition? Yes, of course:

selectStmt := postgres.
    SELECT(Foo.ID, Bar.ID).
    FROM(
        Foo.INNER_JOIN(Bar, Bar.RelationableID.EQ(Foo.ID).
                                           AND(Bar.RelationableType.EQ(String("foo"))),
        ),
    ).
   WHERE xxx

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@phlisg
Comment options

Answer selected by phlisg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants