Skip to content

Commit a18f47f

Browse files
author
Simon Thörnqvist
committed
encode tvp type param
1 parent 20aef6c commit a18f47f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/tds/types.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ defmodule Tds.Types do
506506
:date -> encode_date_type(param)
507507
:time -> encode_time_type(param)
508508
:uuid -> encode_uuid_type(param)
509+
:tvp -> encode_tvp_type(param)
509510
_ -> encode_string_type(param)
510511
end
511512
end
@@ -579,6 +580,11 @@ defmodule Tds.Types do
579580
encode_data_type(%{param | type: :datetimeoffset})
580581
end
581582

583+
def encode_tvp_type(%Parameter{value: value} = param) do
584+
type = @tds_data_type_tvp
585+
data = <<type>> <> <<0, 0>> <> <<0, 0>> <> <<0, 0>>
586+
{type, data, []}
587+
end
582588

583589
def encode_binary_type(%Parameter{value: value} = param)
584590
when value == "" do

0 commit comments

Comments
 (0)