Skip to content

fix(elixir-client): add Ecto.ULID support in Ecto adapter where bindings#4103

Open
acoBOYZ wants to merge 1 commit intoelectric-sql:mainfrom
acoBOYZ:fix/elixir-ulid-ecto-adapter
Open

fix(elixir-client): add Ecto.ULID support in Ecto adapter where bindings#4103
acoBOYZ wants to merge 1 commit intoelectric-sql:mainfrom
acoBOYZ:fix/elixir-ulid-ecto-adapter

Conversation

@acoBOYZ
Copy link
Copy Markdown

@acoBOYZ acoBOYZ commented Apr 8, 2026

What this PR does

This PR fixes Ecto.ULID support in ecto adapter where queries.

Before this, ULID bound params were not handled in dump_binding/2 correctly.
Now ULID values are dumped with Ecto.Type.dump(Ecto.ULID, value) and rendered as UUID string in SQL.

Changes

  • add Ecto.ULID handling in postgres adapter dump_binding/2 (single + list)
  • keep existing parameterized type logic unchanged
  • add tests for:
    • where field == ^ulid
    • where field in ^ulid_list
    • shape_from_query!/1 with ULID bound param

Tests I made

I used this setup on my computer:

  • DATABASE_URL=postgresql://super:ely_change_me@localhost:5432/testdb?sslmode=disable
  • ELECTRIC_URL=http://localhost:3350
  • ELECTRIC_PORT=3350

Commands:

  • mix test test/electric/client/ecto_adapter/postgres_test.exs
  • mix test test/electric/client/ecto_adapter_test.exs

Results:

  • postgres_test.exs: 4 tests, 0 failures
  • ecto_adapter_test.exs: 24 tests, 0 failures

Related issue

- handle Ecto.ULID in postgres dump_binding

- render ULID params as UUID strings in where SQL

- add tests for ULID equality and IN

- add shape_from_query ULID where test
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.

1 participant