Is Ecto a necessary component of a Phoenix project?

I am trying my hand at a simple Elixiir project described at Simple Elixir web page - use Phoenix or not? and decided to go with Phoenix.
After starting the project I see that the project configuration included Ecto and Postgrex. As I don’t need them in the project how would I remove them from the dependencies if that is actually possible?

PS. Do you need a certain rank to add new tags?


To add tags in general, you need memberlevel 1 AFAIK, to create new ones you need to be mod or admin or somewhat IIRC :wink: I can’t find the list of levels though, so perhaps someone else can tell more accurately.

About your actual problem:

Of course it is possible. When starting out you just need to pass --no-ecto on the CLI.

If you want to remove it from an existing project you need to remove it from the list of deps first, then remove <YourApp>.Repo That should do it. If you already had models/schemes though, you need to rewrite them to work on top of something else then.


Would remoivng it from the list of deps mean removing the lines containing ecto and Postgrex from mix.exs and running mix again?
Which file contains <YourApp>.Repo?

1 Like

I mean the list of does in mix exs, yes.

Which file contains the repo does depend on the which cmd you used exactly to generate the project and which version of Phoenix the generator was for.

And no no mix new required. Just deps get.

Mobile typed.