Skip to content

Join by multiple fields #234

@lishine

Description

@lishine

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
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions