Skip to content

Is it possible to make a join by condition? #363

Closed Answered by houten11
RomanOrlovDev asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, it is possible:

    var source ReadableTable = Actor

    if someCondition {
       source = source.LEFT_JOIN(ActorInfo, ActorInfo.ActorID.EQ(Actor.ActorID))
    }

    stmt := postgres.SELECT(Actor.ActorID).FROM(source)

You'd probably need to select columns dynamically also.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RomanOrlovDev
Comment options

You must be logged in to vote
0 replies
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