Proposal: Add Repo.select_all to return {row count, results} similar to update_all and delete_all

8 views
Skip to first unread message

danie...@gmail.com

unread,
Oct 12, 2025, 5:49:27 AM (4 days ago) Oct 12
to elixir-ecto

Currently, when fetching data with Repo.all/2, users have no way to obtain the count of

returned rows without either:

1. Calling Enum.count/1 on the results.

2. Running a separate Repo.aggregate.

However, database adapters already return the row count, Repo.all and Repo.all_by simply discards it by calling elem(1) on the {count, rows} tuple.


Reply all
Reply to author
Forward
0 new messages