在 Erlang ODBC 中处理 `nvarchar(MAX)` 问题的任何解决方法?

Any workarounds for handling issues with `nvarchar(MAX)` in Erlang ODBC?

Erlang ODBC 中似乎存在一些与 nvarchar(MAX)varchar(MAX) 有关的问题。

例如 运行ning SELECT 'Bob' [name], 50 [age] FOR JSON PATH 应该给出以下内容:

JSON_F52E2B61-18A1-11d1-B105-00805F49916B
-----------------------------------------
[{"name":"Bob","age":50}]

Erlang ODBC 产生:

{:selected, ['JSON_F52E2B61-18A1-11d1-B105-00805F49916B'],
 [
   [
     <<0, 0, 80, 0, 114, 0, 111, 0, 75, 246, 34, 87, 97, 33, 0, 128, 32, 0, 70, 0, 105, 0, 108, 0, 74, 246, 33, 87, 92, 34, 0, 128, 105, 0, 99, 0, 114, 0, 111, 0, 73, 246, 32, 87, 102, 35, 0, 128, 32,
       0>>
   ]
 ]}

和另一个 运行 ...

{:selected, ['JSON_F52E2B61-18A1-11d1-B105-00805F49916B'],
 [[<<0, 0, 0, 0, 0, 0, 0, 0, 207, 63, 70, 190, 0, 5, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 204, 63, 69, 190, 253, 6, 0, 138, 7, 0, 0, 0, 67, 0, 0, 0, 205, 63, 68, 190, 0, 7, 0, 137, 112, 97>>]]}

我正在使用以下连接设置:

timeout: 30_000,
auto_commit: :on,
binary_strings: :on,
tuple_row: :off,
scrollable_cursors: :off,
trace_driver: :off,
extended_errors: :on

FOR JSON clause is of type nvarchar(MAX)的输出。

请问在 Erlang ODBC 中是否有解决 nvarchar(MAX) 问题的解决方法。

有一个解决方案在 windows 上运行良好:通过 ODBC 使用 OLEDB 提供程序,如下所示

 conn = "Provider=MSDASQL;DRIVER={SQL Server};SERVER=#{server};PORT=#{port};DATABASE=#{db};UID=#{uid};PWD=#{pwd};"

    :odbc.connect(
      to_charlist(conn),
      timeout: 30_000,
      # auto_commit: true,
      binary_strings: :on,
      tuple_row: :off,
      # scrollable_cursors: :off,
      # trace_driver: :off,
      extended_errors: :on
    )