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

Update the guide about upsert-operations to document the targetWhere property of onConflictDoUpdate() #475

Open
Greenheart opened this issue Jan 6, 2025 · 0 comments

Comments

@Greenheart
Copy link

Greenheart commented Jan 6, 2025

In the section about PostgreSQL and SQLite of https://orm.drizzle.team/docs/guides/upsert, one example passes the setWhere property to onConflictDoUpdate(). However, the guide doesn't mention the targetWhere property, nor describe when it is useful. It would also be good to describe the difference between the two properties to explain when to use which one of them.

Suggested improvements:

  • Add an example showing how to use targetWhere, and describing how it works. E.g. show the generated SQL statement.
  • Describe the difference between setWhere and targetWhere, and when to use which one of them.

This might be useful to describe how the upsert operation works in SQLite, and the difference between setWhere and targetWhere: https://www.sqlite.org/lang_upsert.html

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