How much work to update an Ecto2 adapter to Ecto3?

Hi. Last year I started working on that transition, what so ever, as per discussion with Jose, the ecto part should be merged into ecto_sql repo. So far effort is here but I haven’t work on that last 3 months since I haven’t had time. I must say that there is not much work, most of the work is to check integration test which I’m sure they are passing all but some MSSQL features do not work as in case of postgresql or mysql.

For instance:

  • MSSQL datetime2 has 7 digitis precision, and elixir DateTime has only 6.
  • “LIKE” wildcarding works only on vrachar and nvarchar fields, most of integration test like is tested over text or ntext fields
  • TDS library uses erlang datetime tuple to work with date and time attributes, so loader and dumpers need to be created in MSSQL ecto adapter BUT cosidering above precision issue, I’m sure there are some edge cases that will cause some unexpexted results, e.g. since rounding last digit in nanosec it may exclude some results.
  • Transactions in MSSQL works differently comparing to transactions in postgresql, once failed transaction (error in query execution) will continue and allow execution of next batch in transaction, and that is not what ecto expects, I did some TDS driver changes that should if last batch in transaction is successful or not and allow executing next if previous didn’t error, but question is, if you are using MSSQL what behavior do you expect?
  • Some integration test threats binary as strings, in MSSQL that is not the case, and in most cases it will not pass.

Above are what I know so far. In ecto2 I copied integration test and chnage schemas so they fit MSSQL server more, but for ect_sql I think there should be some changes in integration test or to tag some unit test to skip in case of mssql.

BTW, TDS driver is migrated to DBConnection 2

EDIT:

The branch in github is tds-support

5 Likes