fix(elixir-client): add Ecto.ULID support in Ecto adapter where bindings#4103
Open
acoBOYZ wants to merge 1 commit intoelectric-sql:mainfrom
Open
fix(elixir-client): add Ecto.ULID support in Ecto adapter where bindings#4103acoBOYZ wants to merge 1 commit intoelectric-sql:mainfrom
acoBOYZ wants to merge 1 commit intoelectric-sql:mainfrom
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/2correctly.Now ULID values are dumped with
Ecto.Type.dump(Ecto.ULID, value)and rendered as UUID string in SQL.Changes
Ecto.ULIDhandling in postgres adapterdump_binding/2(single + list)where field == ^ulidwhere field in ^ulid_listshape_from_query!/1with ULID bound paramTests I made
I used this setup on my computer:
DATABASE_URL=postgresql://super:ely_change_me@localhost:5432/testdb?sslmode=disableELECTRIC_URL=http://localhost:3350ELECTRIC_PORT=3350Commands:
mix test test/electric/client/ecto_adapter/postgres_test.exsmix test test/electric/client/ecto_adapter_test.exsResults:
postgres_test.exs: 4 tests, 0 failuresecto_adapter_test.exs: 24 tests, 0 failuresRelated issue