Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join by multiple fields #234

Open
lishine opened this issue Sep 24, 2020 · 1 comment
Open

Join by multiple fields #234

lishine opened this issue Sep 24, 2020 · 1 comment

Comments

@lishine
Copy link

lishine commented Sep 24, 2020

How to:

SELECT * from X
JOIN Y
ON y.id1 = x.yid OR y.id2 = x.yid

Actually I can do this, right?

    type HitbtcPayment @model(table: "hitbtc_payments", pk: "id") {
        id: ID!
        offchainId: ID!
        status: String
        currency: String
        amount: String
        createdAt: String
        errorCode: Int
        errorMessage: String
        errorDescription: String
        address: String
    }

    type Order @model(table: "orders", pk: "id") {
        id: ID!
        clientId: String
        clientUserId: String
        customerId: ID @private
        createdAt: String
        status: String
        paymentId: HitbtcPayment @relate(on: { from: "payment_id", to: "id" })
        paymentOffchainId2: HitbtcPayment @relate(on: { from: "payment_id", to: "offchain_id" })
        amount: String
        productCode: String
        quantity: String
    }
@lishine
Copy link
Author

lishine commented Sep 25, 2020

The above worked
But I think this should be a feature, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant