Phoenix MSSQL - Problem with tds_ecto

create new phoenix app with mssql database
mix phoenix.new myapp --database mssql

then apply mssql setting on
config/dev.exs
config/test.exs

run command
mix ecto.create

got this error

==> tds_ecto
Compiling 2 files (.ex)

== Compilation error on file lib/tds_ecto.ex ==
** (CompileError) lib/tds_ecto.ex:47: module Tds is not loaded and could not be found
could not compile dependency :tds_ecto, "mix compile" failed. You can recompile this dependency with "mix deps.compile tds_ecto", update it with "mix deps.update tds_ecto" or clean it with "mix deps.clean tds_ecto"

already try to add tds module manually by adding
{:tds, "~> 0.2"}
to mix.exs file but still got the error above

note :
Phoenix v1.2.1
{:phoenix_ecto, "~> 3.0"}
{:tds_ecto, ">= 0.0.0"}

1 Like

Well, here’s the thing: looks like Phoenix does support generation of the application using mssql, but also sqlite3 and mongodb drivers. However, those drivers are not compatible with Ecto 2.0. It also specifies any tds_ecto version which looks like a placeholder.

Do update the last line you posted in note above to most recent release of tds_ecto and run mix deps get again. It still should not work but it will give you info about incompatible Ecto versions. I think you can try downgrading phoenix_ecto to 2.x branch and give it a shot.

Having said all the above, I am not sure if there will not be more trouble along the way. I would expect some of the generated code won’t work or will require manual tweaking to make it work.

At this moment, Ecto is limited to good PostgreSQL and fairly good MySQL support - anything else is risky :slight_smile:

1 Like

Thanks

Downgrading phoenix_ecto to 2.x and upgrading tds_ecto to 1.0 do the trick, hope they will upgrade those drivers soon.

1 Like