Commit 120ebeb
committed
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
1 parent a6321c3 commit 120ebeb
3 files changed
Lines changed: 514 additions & 153 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
0 commit comments