[0.4.1] - 2026-06-12

Changed

  • Repository moved to https://github.com/saschabrink/ecto_context — package metadata, docs links, and license now reflect the maintainer's real name.
  • CI tests against Elixir 1.19 and 1.20 via the Nix flake dev shells.
  • README badges for CI status and license, alongside the existing hex/hexdocs pair.

Fixed

  • The precommit alias misspelled --warnings-as-errors, so compiler warnings were never treated as errors locally.

[0.4.0] - 2026-06-12

Breaking

  • Repo inference is now strict: without an explicit repo: (declaration or config :ecto_context, :defaults), the repo is taken from the host app's :ecto_repos only when exactly one is configured. With several repos, ecto_context previously picked the first silently — it now raises at compile time with the candidate list and the config line to copy.

Changed

  • Dev environment updated to Elixir 1.20

Fixed

  • Generated functions no longer trigger Elixir 1.20 type warnings ("will always evaluate to dynamic(true)") in contexts with intentional always-true permission clauses, e.g. public reads (def permission(:get, _, _), do: true). Permission checks now go through EctoContext.permitted?/4, which keeps the callee opaque to the type checker's call-site specialization.
  • ecto_context no longer crashes with a CaseClauseError at compile time when the host app configures ecto_repos: [] — it raises a descriptive error instead.
  • Removed dead has_excluded_module?/2 base clause in NoUnscopedRepoInsideAppLib that Elixir 1.20 correctly identifies as unreachable (call site already guards against an empty exclusion list)

[0.3.3] - 2026-05-17

Added

  • NoEctoQueryOutsideAppLib — new Credo check that bans alias Ecto.Query and import Ecto.Query in lib/ outside lib/[app]/. Keeps query composition out of the web layer. Supports :excluded_paths.

[0.3.2] - 2026-05-12

Added

[0.3.1] - 2026-05-08

Added

  • NoRepoOutsideAppLib: new :excluded_paths option — list of path prefixes skipped entirely by the check. Use for directories where direct Repo access is intentional, e.g. excluded_paths: ["lib/mix/tasks"].

[0.3.0] - 2026-05-08

Breaking

  • NoUnscopedRepoInsideAppLib: :allowed_schemas renamed to :excluded_schemas. Update your .credo.exs accordingly.

Added

  • NoUnscopedRepoInsideAppLib: new :excluded_paths option — list of path prefixes (e.g. ["lib/mix/tasks"]) that are skipped entirely by the check.

[0.2.0] - 2026-05-08

Breaking

[0.1.5] - 2026-05-08

Added

  • EctoContext.Check.ForceScoped — optional Credo check (requires {:credo, "~> 1.7"}) that enforces use of generated scoped functions in ecto_context modules. Bans direct Repo calls for operations ecto_context covers (all, get, get!, get_by, get_by!, insert, insert!, update, update!, delete, delete!, aggregate); allows everything else (transact, delete_all, insert_all, update_all, …). Repos are configured via repos: [MyApp.Repo] or auto-detected from :ecto_repos.
  • EctoContext.Check.DeprecateRepoTransaction — flags Repo.transaction/2 project-wide and points to Repo.transact/2, the official Ecto replacement.

[0.1.4] - 2026-04-30

Added

  • get_by and get_by! now support :order_by and :limit options, enabling "fetch first matching by ordering" patterns without a custom :query function

[0.1.3] - 2026-04-30

Fixed

  • README and usage-rules.md now correctly document get, get!, get_by, get_by! opts (:preload, :select, :query)
  • usage-rules.md clarifies that :query is always a 1-arity function; separates list-family opts from get-family opts

[0.1.2] - 2026-04-30

Added

  • get, get!, get_by, get_by! now support :select and :query options
  • All four get-family functions now accept the same uniform option set: :preload, :select, :query

[0.1.1] - 2026-04-17

Added

  • usage-rules.md — focused LLM-oriented rules file ships with the hex package. Covers return-value shapes, scope/2 vs permission/3, the :get unauthorized-collapses-to-nil trap, and common API pitfalls.
  • README section pointing AI agents at deps/ecto_context/usage-rules.md.

[0.1.0] - 2026-04-13

Added

  • ecto_context/2 macro for generating scoped CRUD functions
  • 16 generated functions: list, list_by, list_for, get, get!, get_by, get_by!, create, create_for, update, delete, change, count, paginate, subscribe, broadcast
  • EctoContext.Query — runtime query helpers
  • EctoContext.Validate — runtime validation helpers
  • EctoContext.Paginator — pagination struct