Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ocean/ecto_libsql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.8.8
Choose a base ref
...
head repository: ocean/ecto_libsql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.8.9
Choose a head ref
  • 12 commits
  • 9 files changed
  • 3 contributors

Commits on Jan 27, 2026

  1. Configuration menu
    Copy the full SHA
    8b94208 View commit details
    Browse the repository at this point in the history
  2. fix: handle Ecto.Query.Tagged structs in IN clauses (e.g. ~w() sigil …

    …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 <[email protected]>
    ocean and ampcode-com committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    3a3e977 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7d43878 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #65 from ocean/list-datatype-fixes

    Datatype fixes for lists in IN clauses
    ocean authored Jan 27, 2026
    Configuration menu
    Copy the full SHA
    3946843 View commit details
    Browse the repository at this point in the history
  5. fix: handle Ecto.SubQuery in IN expressions

    The catch-all IN clause handler was wrapping SubQuery expressions in
    JSON_EACH(), producing invalid SQL like:
      WHERE id IN (SELECT value FROM JSON_EACH(?))
    
    This adds a specific pattern match for %Ecto.SubQuery{} before the
    catch-all, generating proper inline subqueries:
      WHERE id IN (SELECT s0.id FROM table AS s0 WHERE ...)
    
    Also adds a general SubQuery expression handler that properly resolves
    parent query aliases and combination queries.
    
    This fixes compatibility with libraries like Oban that use subqueries
    in UPDATE...WHERE id IN (subquery) patterns.
    nadilas committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    5a08eaf View commit details
    Browse the repository at this point in the history
  6. fix: handle Ecto.Query.Tagged in expr for type-cast fragments

    Ecto's query planner transforms {:type, _, [expr, type]} AST nodes
    into %Ecto.Query.Tagged{} structs. The SQL generator only handled
    the pre-planning tuple form, causing type-wrapped fragments (e.g.
    type(fragment(...), :integer)) to fall through to the catch-all
    expr clause which rendered a single '?' placeholder. This caused
    parameter count mismatches with Hrana/Turso.
    
    Fixes Oban Web JobQuery.limit_query crash on completed jobs page.
    nadilas committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    9ef48fa View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2026

  1. Configuration menu
    Copy the full SHA
    16218bc View commit details
    Browse the repository at this point in the history
  2. Merge pull request #66 from nadilas/fix/subquery-in-expression

    fix: handle Ecto.SubQuery in IN expressions
    ocean authored Jan 28, 2026
    Configuration menu
    Copy the full SHA
    53402e2 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #67 from nadilas/fix/tagged-struct-expr-handling

    Fix/tagged struct expr handling
    ocean authored Jan 28, 2026
    Configuration menu
    Copy the full SHA
    d2f693c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a6321c3 View commit details
    Browse the repository at this point in the history
  5. test: add comprehensive IN expression test suite for issues #63, #66, #…

    …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
    ocean committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    120ebeb View commit details
    Browse the repository at this point in the history
  6. docs: Update changelog

    ocean committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    16c8ecd View commit details
    Browse the repository at this point in the history
Loading