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

Add OnConflict to InsertValues #61

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

NPCRUS
Copy link
Contributor

@NPCRUS NPCRUS commented Jan 11, 2025

Fixes #50
Fixed Returning.InsertBase[V[Expr]] into Returning.InsertBase[V[Column]], looks like an oversight,
this basically enabled me to write an implicit in OnConflictOps that made this fix possible
@lihaoyi I'm not sure how to organize tests in this case, I hope you could have an idea, because current OnConflictTests are based on functionality and they don't distinguish between internal implementation of two different insert modes: InsertValues and InsertColumns, I could have just duplicated the tests with .insert.values(???), but it doesn't seem right.
Another question is that there are kinda missing tests for InsertSelect and then conflicts, do you want me to add those or was it intentional to not have them?

@lihaoyi
Copy link
Member

lihaoyi commented Jan 11, 2025

Duplicate-ish tests is fine I think. Feel free to add other tests if you would like. Just give the descriptive names and descriptions

@lihaoyi
Copy link
Member

lihaoyi commented Jan 11, 2025

The "reference" docs generated from the test suite are meant to be searched, so having a few extra cases probably isnt' a big deal

@NPCRUS NPCRUS marked this pull request as ready for review January 11, 2025 14:13
@NPCRUS
Copy link
Contributor Author

NPCRUS commented Jan 11, 2025

@lihaoyi I found separate issue with InsertSelect and then OnConflict, created separate issue for it, that's why there're no related tests here, otherwise pr is ready

@lihaoyi lihaoyi merged commit 36df327 into com-lihaoyi:main Jan 13, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

ON CONFLICT (column) IGNORE for batch insert(Postgres)
2 participants