Generate schema from existing database

Hi folks,

I’m creating a new json api with Phoenix and I want to use Ecto with an existing Sql Server database (Tds adapter). What I want to have is Phoenix auto loading schema/models from there. I have read lot of instructions, most of run like: mix ecto.dump && mix ecto.load to create kinda a structure.sql and go from there but when trying to do that I have errors and I don’t find any documentation about that when using Tds adapter.

mix ecto.dump
** (Mix) Expected Ecto.Adapters.Tds to implement Ecto.Adapter.Structure in order to dump structure for StrategiesHistoryApi.Repo

Could someone help me with that? Thanks!

mix ecto.dump and mix ecto.load expect the adapter to implement the behaviour Ecto.Adapter.Structure so that it has the functions needed to create the dump file and load it. It looks like the TDS adapter doesn’t have that.

I would open an issue in ecto_sql and if you have any details about how dumping is done in SQL Server that would help them.