-
Notifications
You must be signed in to change notification settings - Fork 2
Datatype fixes for lists in IN clauses #65
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
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019bfe38-44f9-74fc-b369-9b0ab4ee93e8 Co-authored-by: Amp <amp@ampcode.com>
…from oban) - Add catch-all expr clause for IN with non-list right side - Extract list values from Ecto.Query.Tagged structs before generating IN clause - Fall back to JSON_EACH for pre-encoded JSON arrays - Fixes issue #63: Oban job state queries using ~w() sigil now work correctly Amp-Thread-ID: https://ampcode.com/threads/T-019bfe38-44f9-74fc-b369-9b0ab4ee93e8 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019bfe38-44f9-74fc-b369-9b0ab4ee93e8 Co-authored-by: Amp <amp@ampcode.com>
WalkthroughThis pull request fixes IN clause handling for Ecto.Query.Tagged structs in the libSQL adapter. It adds a new catch-all clause to unwrap Tagged values before generating IN clauses, includes a corresponding test case, updates the changelog, and configures two new MCP permissions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
…67 Adds in_expression_comprehensive_test.exs to catch regressions in: 1. Issue #63: JSON encoding of list parameters in IN clauses - Simple list parameters should expand to individual placeholders - ~w() sigils should be handled via %Ecto.Query.Tagged{} detection 2. PR #66: Subqueries in IN expressions (Oban pattern) - WHERE id IN (SELECT ...) should generate proper SQL subquery - Before fix: incorrectly wrapped in JSON_EACH() causing malformed JSON error - After fix: generates inline subquery with correct aliases 3. PR #67: Tagged struct and type-wrapped expressions - Post-planning %Ecto.Query.Tagged{} nodes must be handled - Type-wrapped fragments should not fall through to catch-all '?' placeholder - Before fix: parameter count mismatch with Hrana/Turso - After fix: correct parameter count and proper type handling Tests include: - Basic list parameter expansion - Empty lists and single-element lists - ~w() sigil handling (Oban Lite pattern) - Multiple IN clauses combined - Subqueries with WHERE, SELECT, complex filters - Type-cast expressions - Integration tests combining multiple patterns All 15 tests pass with the fixes in place. Relates to: #63, PR #65, PR #66, PR #67
Hopefully a real fix for #63 this time.
Summary by CodeRabbit
Bug Fixes
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.