feat(upsert): remove _uid from update checks and add test for upsert …#874
feat(upsert): remove _uid from update checks and add test for upsert …#874ArnabChatterjee20k wants to merge 2 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR allows
Confidence Score: 5/5Safe to merge — the functional change is limited to MariaDB's ON DUPLICATE KEY UPDATE path, the Postgres and SQLite adapters are unaffected at runtime, and the new test covers the intended scenario end-to-end. The adapter edits are minimal and well-scoped: removing No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into upsert-update-u..." | Re-trigger Greptile |
| if (!$database->getAdapter()->getSupportForUpsertOnUniqueIndex()) { | ||
| $this->expectNotToPerformAssertions(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Missing adapter method — test will throw a fatal error
getSupportForUpsertOnUniqueIndex() is called here but is not declared in src/Database/Adapter.php (which defines all getSupportFor* abstract methods) and is not implemented in any adapter class. PHP will throw a fatal Call to undefined method error when this test runs, so it can never reach the assertion block or even skip gracefully. The method needs to be added as an abstract declaration in Adapter.php and implemented in each concrete adapter (returning true for MariaDB, which uses ON DUPLICATE KEY UPDATE for any unique constraint, and false for Postgres/SQLite, which use ON CONFLICT ("_uid") and cannot catch conflicts on other unique indexes).
There was a problem hiding this comment.
no its present
There was a problem hiding this comment.
You're right, my apologies — getSupportForUpsertOnUniqueIndex() is present in Adapter.php and all the concrete adapters. My comment was incorrect.
Tip: You can give me more context with .greptile/rules.md so I get this right next time.
…on unique index