elixir-ecto / ecto_sql

SQL-based adapters for Ecto and database migrations
https://hexdocs.pm/ecto_sql
Apache License 2.0
578 stars 312 forks source link

Introduce Ecto.SQLRepo #637

Open josevalim opened 1 month ago

josevalim commented 1 month ago

Elixir version

All

Database and Version

All

Ecto Versions

All

Database Adapter and Versions (postgrex, myxql, etc)

All

Current behavior

Today, we define several functions in Ecto.Adapters.SQL and we generate functions with docs inside the Ecto.Repo. This is a contrast to how Ecto.Repo works, which defines several callbacks in Ecto.Repo and lets the documentation tool tie them together.

Expected behavior

My suggestion is to introduce Ecto.SQLRepo which defines all relevant callbacks for the functions we generate, making them more consistent. The Ecto.Adapters.SQL API can then focus on custom adapter implementations.

There is no rush to implement this. I am documenting this for posteriority.