Depend on ecto instead of ecto_sql#2116
Merged
Merged
Conversation
Backpex only uses Ecto.Query, Ecto.Changeset and Ecto.Repo, all of which live in the :ecto application. Nothing from :ecto_sql is referenced — the only `use Ecto.Migration` occurrences are inside @moduledoc examples, and neither the library code nor its test suite touches Ecto.Adapters. Declaring ecto_sql made Backpex constrain a package it does not use. Host applications bring their own SQL adapter, so nothing changes for them in practice.
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
Backpex declares
{:ecto_sql, "~> 3.6"}, but nothing from:ecto_sqlis used.Evidence
The library uses
Ecto.Query,Ecto.ChangesetandEcto.Repo— all of which live in the:ectoapplication, not:ecto_sql.:ecto_sqladds the SQL adapters, migrations andmix ecto.*tasks on top.The only occurrences of an
:ecto_sqlmodule are inside documentation:All three sit inside
@moduledocexamples showing users how to write the migration for an upload field — they are documentation text, never compiled. Backpex's own test suite does not use a repo at all, and no adapter is configured inconfig/.Impact
This is the only user-facing part: Backpex no longer pulls
ecto_sqlin transitively, onlyecto.In practice nothing changes — any application using Backpex has an
Ecto.Repobacked by a SQL adapter, and therefore already declaresecto_sqlitself. The demo does exactly that (demo/mix.exs:73) and compiles unchanged against this branch. What goes away is Backpex constraining the version of a package it never touches, which is what turnednumber's staledecimalpin into a blockedecto_sql3.14 update (#2113).If you would rather keep the declaration as a convenience for users, the alternative is to leave
ecto_sqlin place — happy to close this.Verification
mix lintpasses end to end (compile --warning-as-errors,deps.unlock --unused,format,credo, 100 doctests + 174 tests, 0 failures).mix docs --warnings-as-errorsbuilds.ecto_sqlstill indemo/mix.lockvia its own declaration.Context
Found by a dependency check I am preparing separately, which reports dependencies that are declared but never referenced by the compiled code — the blind spot
mix deps.unlock --check-unusedcannot cover, since it only comparesmix.lockagainstmix.exs.