New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb_ecto #ecto-2 for phoenix #128

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
@zeroasterisk

There were version conflicts, I had to fight a bit, but this seems to pass deps.get

it now builds ok for an "old" version of phoenix:

https://github.com/zeroasterisk/example-elixir-meteor-api/blob/master/mix.exs#L41-L43

     # the mongodb_ecto & phoenix_ecto, both need to require same {:ecto, "~> 2.0"}
     {:phoenix_ecto, github: "phoenixframework/phoenix_ecto", ref: "v3.0.1"},
     {:mongodb_ecto, github: "zeroasterisk/mongodb_ecto", branch: "elixir-ecto-v2.0.1"},

re #127

@ankhers

This comment has been minimized.

Show comment
Hide comment
@ankhers

ankhers Jun 21, 2017

Owner

We are not going to merge this right now. We are specifically using a version of ecto from git because it has some additional fixes that have not been pushed to hex yet. You should probably just do something like {:ecto, "~> 2.0", override: true} as your dependency. Or you can use the version from git as the override.

Owner

ankhers commented Jun 21, 2017

We are not going to merge this right now. We are specifically using a version of ecto from git because it has some additional fixes that have not been pushed to hex yet. You should probably just do something like {:ecto, "~> 2.0", override: true} as your dependency. Or you can use the version from git as the override.

@ankhers ankhers closed this Jun 21, 2017

@zeroasterisk

This comment has been minimized.

Show comment
Hide comment
@zeroasterisk

zeroasterisk Jun 21, 2017

Ok - not a problem. Just to be clear, I was not able to create a new phoenix project (stable version) and add in any version of mongodb_ecto and make it work.

This seems like something that will cause a lot of problems/confusion.

$ mix phoenix.new example --no-html --no-brunch
$ cd example

mix.exs
{:mongodb_ecto, "~> 0.1"},

$ mix deps.get
Failed to use "ecto" (version 2.1.4) because
  mongodb_ecto (versions 0.1.3 to 0.1.5) requires ~> 1.0.0
  phoenix_ecto (version 3.2.3) requires ~> 2.1
  mix.lock specifies 2.1.4

mix.exs
{:mongodb_ecto, github: "michalmuskala/mongodb_ecto", branch: "ecto-2"},

$ mix deps.get
Dependencies have diverged:
* ecto (https://github.com/elixir-ecto/ecto.git)
  different specs were given for the ecto app:

  > In deps/mongodb_ecto/mix.exs:
    {:ecto, "~> 2.0.0", [env: :prod, git: "https://github.com/elixir-ecto/ecto.git", ref: "v2.0", 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

zeroasterisk commented Jun 21, 2017

Ok - not a problem. Just to be clear, I was not able to create a new phoenix project (stable version) and add in any version of mongodb_ecto and make it work.

This seems like something that will cause a lot of problems/confusion.

$ mix phoenix.new example --no-html --no-brunch
$ cd example

mix.exs
{:mongodb_ecto, "~> 0.1"},

$ mix deps.get
Failed to use "ecto" (version 2.1.4) because
  mongodb_ecto (versions 0.1.3 to 0.1.5) requires ~> 1.0.0
  phoenix_ecto (version 3.2.3) requires ~> 2.1
  mix.lock specifies 2.1.4

mix.exs
{:mongodb_ecto, github: "michalmuskala/mongodb_ecto", branch: "ecto-2"},

$ mix deps.get
Dependencies have diverged:
* ecto (https://github.com/elixir-ecto/ecto.git)
  different specs were given for the ecto app:

  > In deps/mongodb_ecto/mix.exs:
    {:ecto, "~> 2.0.0", [env: :prod, git: "https://github.com/elixir-ecto/ecto.git", ref: "v2.0", 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
@ankhers

This comment has been minimized.

Show comment
Hide comment
@ankhers

ankhers Jun 22, 2017

Owner

Yes. This is a known issue. None of the current released versions of this adapter work with the newer versions of ecto.

The work being done on the ecto-2 branch is to help bring this forward to work with ecto 2.0. Unfortunately during the update, we have found a couple of issues with ecto itself (which is why the ecto-2 branch currently points to a git reference) that need to be addressed in order to have proper compatibility.

The work being done on the ecto-2.1 branch is to make this adapter work with ecto 2.1. We have not yet put a lot of time into working on this branch because of various reasons. I can only speak for myself, but I have not had the time I need to properly work on the upgrade. I also purposefully pushed a feature back in my application so that I would not need ecto 2.1 compatibility yet.

Unfortunately, with this being an in-development version of the adapter, things will not work as smoothly as if it were properly released. As I said in my previous comment, you are going to need to specify a version of ecto as {:ecto, "~> 2.0", override: true}. The key part being override: true. This will force all dependencies that need ecto to use that specific version. You may want to specify the git ref like this adapter does in order to have the most features working.

Owner

ankhers commented Jun 22, 2017

Yes. This is a known issue. None of the current released versions of this adapter work with the newer versions of ecto.

The work being done on the ecto-2 branch is to help bring this forward to work with ecto 2.0. Unfortunately during the update, we have found a couple of issues with ecto itself (which is why the ecto-2 branch currently points to a git reference) that need to be addressed in order to have proper compatibility.

The work being done on the ecto-2.1 branch is to make this adapter work with ecto 2.1. We have not yet put a lot of time into working on this branch because of various reasons. I can only speak for myself, but I have not had the time I need to properly work on the upgrade. I also purposefully pushed a feature back in my application so that I would not need ecto 2.1 compatibility yet.

Unfortunately, with this being an in-development version of the adapter, things will not work as smoothly as if it were properly released. As I said in my previous comment, you are going to need to specify a version of ecto as {:ecto, "~> 2.0", override: true}. The key part being override: true. This will force all dependencies that need ecto to use that specific version. You may want to specify the git ref like this adapter does in order to have the most features working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment