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

Fix argument types of onConflict #2635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Apr 1, 2024

  1. Fix argument types of onConflict

    `onConflict` should accept any column reference, including `raw()` and `ref()` as input. This may be required to specify a conflict condition on a partial index, e.g. we use a query like this which works just fine for us:
    
    ```typescript
    await Resource._query()
      .insert(resources)
      .onConflict(raw(`(aka) where status != 'DELETED'`))
      .merge()
    ```
    
    This is explicitly supported by knex: https://knexjs.org/guide/query-builder.html#onconflict
    jhecking committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    27aeea8 View commit details
    Browse the repository at this point in the history