Skip to content

Allow selecting fragment source with columns#4760

Merged
greg-rychlewski merged 3 commits into
elixir-ecto:masterfrom
greg-rychlewski:select_fragment_source
Jul 21, 2026
Merged

Allow selecting fragment source with columns#4760
greg-rychlewski merged 3 commits into
elixir-ecto:masterfrom
greg-rychlewski:select_fragment_source

Conversation

@greg-rychlewski

Copy link
Copy Markdown
Member

Follow up to the last PR.

Comment thread lib/ecto/query/planner.ex Outdated
@greg-rychlewski
greg-rychlewski force-pushed the select_fragment_source branch from 98cac7e to 6b88c49 Compare July 21, 2026 02:51
@greg-rychlewski
greg-rychlewski force-pushed the select_fragment_source branch from 7fb5d43 to 5d06a69 Compare July 21, 2026 03:13
Comment thread lib/ecto/query/planner.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.

One comment and ship it!!!!

Comment thread lib/ecto/query/planner.ex
Comment on lines +2255 to +2257
if columns = meta[:column_names] do
{{:map, Enum.map(columns, &{&1, {:value, :any}})},
Enum.map(columns, &select_field(&1, ix, :always))}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@josevalim Sorry while making your change I actually noticed we already had a way to handle map creation without adding a new {:source, :fragment, ...} construct. Just letting you take a look again before mering

@greg-rychlewski
greg-rychlewski merged commit 0a30f6b into elixir-ecto:master Jul 21, 2026
8 checks passed
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.

2 participants