I want to write an elixir application performing some ETL work on an SQL Server database (I can see how to do it with ecto, and other ways I can see doing it are harder).
I have found mssql_ecto which does not seem to work with ecto 3, and tds_ecto also seems to not be up to date (I am aware of a fork of ecto_sql but could not glean much from it). Are there any other things I can try to make it work that I have not seen yet?
I’m relatively new to Elixir as well, but for what I’ve seen Ecto adapters for commercial DBs are not updated as often as open source ones. It seems to be just a matter of the number of people using and maintaining those adapters.
You already found what is available for MS SQL. If you want/have to keep working with that DB, you’ll have to use Ecto 2.
@dimitarvp The company I have intended to do this for firmly believes in MSSQL, so those places exist.
@al2o3cr I am not sure whether the original project team will keep maintaining it, they have stated they don’t do much elixir anymore here, casting doubts on that project as a whole. That was the reason I kept looking.
@hectorsq I think that is what I am going to explore next. Thanks for telling me that that works for you.
the :unicode.characters_to_binary and :unicode.characters_to_list calls (strings are character lists in erlang)
https://github.com/tallakt/codepagex in an attempt to convert the data to utf-8 (I enabled the CP1252 encoding in VENDORS/MICSFT/WINDOWS for this)
I was able to query the database with all adapters and drivers. The encoding issue surprisingly took most of the time. Most of the time I got recognizable text intermixed with garbage. The data could be queried correctly with raw SQL in SSMS (the SQL server GUI). There is another account of this difficulty with no solution here.
I suspect that at least one layer in the chain lied about its encoding.
I was not granted much time to try this. The database was not reachable off-premise, either.
and its been working well in pulling what td_ecto returns as binary data if the varchar field returns any characters. Just use the custom type and it seems to decode okay
Another thing to consider is that I don’t think the tds package support Windows Authentication, which is a relevant factor for enterprise applications.