findmypast-oss / mssql_ecto

Ecto adapter for Mssqlex
Apache License 2.0
49 stars 20 forks source link

support for xml column type #16

Open brentweber opened 7 years ago

brentweber commented 7 years ago

I was wondering if you have plans to support xml column type, even if it just returns it as a string. I get the following error when attempting to use this column in my schema as the :string type ** (Mssqlex.Error) Column type not supported | ODBC_CODE | SQL_SERVER_CODE 0

shdblowers commented 7 years ago

Hi @brentweber I will look into whether supporting this requires a change to msql_ecto or a change to Erlang ODBC

shdblowers commented 7 years ago

Hi @brentweber have investigated supporting XML type and will require a change to Erlang ODBC rather than mssql_ecto or mssqlex.

@toddharding is currently looking at making a change to Erlang ODBC to support datetimeoffset, I wonder if it would be possible to support xml via a similar change?

shdblowers commented 7 years ago

Leaving this here for future reference.

Testing XML type.

test "xml", %{pid: pid} do
    assert {_query, %Result{columns: ["test"], rows: [["<message>Hello</message>"]]}} =
      act(pid, "xml", ["<message>Hello</message>"])
  end
brentweber commented 7 years ago

@shdblowers thanks for looking into this, and if @toddharding would be able to support XML type via a similar ODBC change that would be great but after further testing I'm not sure I will be able to use this adapter due to string type limitations. But Im sure someone will have the XML issue in the future.