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

feat: specify custom primary key for BulkInsert(OrUpdate)(OrDelete)(Async) #1472

Closed
tsanton opened this issue Apr 25, 2024 · 1 comment
Closed
Labels

Comments

@tsanton
Copy link

tsanton commented Apr 25, 2024

Have you considered enabling users to specify a custom key for "merges"?

My use case is that I have a table that tracks statuses for a given entity, and the primary key takes the natural form of "EntityId", "id" to avoid key collision on multiple inserts.
I now want to insert statuses where the ["EntityId", "Status"] combination does not exists from before (no issue with conflicts because it's a one way street).
This could be achieved with a custom key of ["EntityId", "Status"], PropertiesToIncludeOnUpdate = [].

My target database is PG.

@borisdj
Copy link
Owner

borisdj commented Apr 25, 2024

Did you checked UpdateByProperties info from ReadMe, that should do it.

@borisdj borisdj closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants