Cross DB Ecto config failing

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 10:28:26

问题


In config/dev.exs:

config :drupex, Drupex.Repo,
  adapter: Ecto.Adapters.Postgres,
  -- username, password, database, hostname, pool_size omitted --

config :drupex, Drupex.DrupalRepo,
  adapter: Ecto.Adapters.Mysql,
  -- username, password, database, hostname omitted --

In mix.exs under defp deps do I added {:mariaex, "~> 0.8.2"}, just after {:postgrex, ">= 0.0.0"}. Finally in lib/drupex/repo.ex I added

defmodule Drupex.DrupalRepo do
  use Ecto.Repo, otp_app: :drupex
end

I ran mix deps.get , mix deps.compile now running mix I get

** (ArgumentError) adapter Ecto.Adapters.Mysql was not compiled, ensure it is correct and it is included as a project dependency

回答1:


Turns out the adapter is called MySQL and it is case sensitive. Changing to adapter: Ecto.Adapters.MySQL, solved the problem.



来源:https://stackoverflow.com/questions/49825883/cross-db-ecto-config-failing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!