I need a new version of Ecto with prefix on insert, delete and update

This PR: https://github.com/elixir-ecto/ecto/pull/2065

I need it. When will we get a new version with it? Can you release it in a patch or we need to wait for the next minor?

And how can I get only this change on top of 2.1.4?

Just explaining what is the real problem.

This kind of tests fail without it:

{:ok, user} = Repo.insert(%User{name: "José"}, prefix: "auth")
assert user == Repo.get!(user.id, prefix: "auth")

If you need something like that, then I would recommend creating your own fork and applying the change you need there on the tag that you want.

Look at the :git options on the mix deps page.

1 Like

Yep, I know, but I’ll need to change phoenix_ecto also, since it depends on ecto 2.1.4 too. :confused:

@michalmuskala or @josevalim, sorry to bother, I know you’re very busy guys, but if it’s not possible to release a patch with this PR, any prevision of when will ecto 2.2. get to our hands? :slight_smile:

Again, sorry for the bothering. :wink:

For those who are bothered for not having it yet like me, you can use my forks branches which have only this change on top of ecto 2.1.4 and phoenix_ecto 3.2.3 tags.

{:ecto, "~> 2.1", github: "kelvinst/ecto", branch: "prefixed-inserts"},
{:phoenix_ecto, "~> 3.2", github: "kelvinst/phoenix_ecto", branch: "prefixed-inserts"},

We’ll look into making a patch release in the coming days.

1 Like

You shouldn’t need to change your phoenix_ecto dependency. It has a liberal dependency on Ecto: https://github.com/phoenixframework/phoenix_ecto/blob/master/mix.exs#L36

1 Like

Well, the reason I did it is this warning when mix deps.getting:

Dependencies have diverged:
* ecto (https://github.com/kelvinst/ecto.git)
  different specs were given for the ecto app:

  > In apps/mstech/mix.exs:
    {:ecto, "~> 2.1", [env: :prod, git: "https://github.com/kelvinst/ecto.git", branch: "prefixed-inserts", manager: :mix]}

  > In deps/phoenix_ecto/mix.exs:
    {:ecto, "~> 2.1", [env: :prod, hex: "ecto", repo: "hexpm", optional: false]}

  Ensure they match or specify one of the above in your deps and set "override: true"
** (Mix) Can't continue due to errors on dependencies

I didn’t want to set override: true, fearing more conflicts on other ecto libraries which could not work properly with this ecto version. But maybe I’m being too conservative for someone who is brave enough to detach the version of ecto just for a simple change like this.

Thanks so much!!! :heart_eyes:

PS.: I guess I’m having this error because my app is within an umbrella project.

Most likely, and override is fine.

1 Like

For those who wonder about it, just tested ecto 2.2.0-rc and it solved the problem!

1 Like