Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send parameters with nil type as type
:string
Before this patch we were sending them as type `:binary`: ```elixir Mix.install([ {:tds, "2.3.5"} ]) defmodule Main do def main do {:ok, pid} = Tds.start_link( hostname: "localhost", username: "sa", password: "secret1@A", database: "mix_install_examples", port: 1433, pool_size: 1 ) Tds.query!(pid, "create table #date_test (x date)", []) Tds.query!(pid, "insert into #date_test values (@param1)", [ %Tds.Parameter{name: "@param1", value: nil} ]) # ** (Tds.Error) Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query. # above is same as this: Tds.query!(pid, "insert into #date_test values (@param1)", [ %Tds.Parameter{name: "@param1", type: :binary, value: nil} ]) # ** (Tds.Error) Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query. # setting the type as :string works: Tds.query!(pid, "insert into #date_test values (@param1)", [ %Tds.Parameter{name: "@param1", type: :string, value: nil} ]) end end Main.main() ``` And so `type: :string` seems like a better default.
- Loading branch information