Skip to content

Add mix ecto.query task#733

Open
cdvx wants to merge 3 commits into
elixir-ecto:masterfrom
cdvx:add-mix-ecto-query-task
Open

Add mix ecto.query task#733
cdvx wants to merge 3 commits into
elixir-ecto:masterfrom
cdvx:add-mix-ecto-query-task

Conversation

@cdvx

@cdvx cdvx commented Jun 12, 2026

Copy link
Copy Markdown

Closes elixir-ecto/ecto#4719

Implements a read-only query Mix task run through the selected or default repo. Accepts --sql to render generated SQL and params for the passed query without running it, otherwise returns schema level output. Raises is adapter does not support read only transactions.

Closes elixir-ecto/ecto#4719

Implements a read-only query Mix task run through the selected or default
repo. Accepts --sql to render generated SQL and params for the passed query
without running it, otherwise returns schema level output.
Raises is adapter does not support read only transactions.
Comment thread lib/mix/tasks/ecto.query.ex Outdated
Comment thread lib/mix/tasks/ecto.query.ex Outdated
Comment thread test/mix/tasks/ecto.query_test.exs Outdated
Comment thread test/mix/tasks/ecto.query_test.exs Outdated
Comment thread lib/mix/tasks/ecto.query.ex Outdated

@josevalim josevalim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I dropped what is likely the final batch of comments and we should be good!

cdvx and others added 2 commits June 23, 2026 11:21
Co-authored-by: José Valim <jose.valim@gmail.com>
- clean up tests
- use inspect_fun opt instead of overriding global state for inspect
- copy implementation of inspect/4 Inspect.Map protocol instead of calling private API directly
- parse only aliases from .iex.exs
@cdvx

cdvx commented Jun 23, 2026

Copy link
Copy Markdown
Author

Sorry for the delay, I dropped what is likely the final batch of comments and we should be good!

No worries at all, thanks for the thorough review! I’ve addressed the comments: .iex.exs now only contributes aliases, inspection uses inspect_fun, and the test setup is cleaned up.

@cdvx cdvx requested a review from josevalim June 23, 2026 11:57
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.

Add mix ecto.query

3 participants