ecto_sql icon indicating copy to clipboard operation
ecto_sql copied to clipboard

allow passing `%Tds.Parameter` structs as params for named parameter usage in `query`

Open simonmcconnell opened this issue 1 year ago • 2 comments
trafficstars

Currently, one cannot pass a list of Tds.Parameter structs to query. They must be basic values/structs. When one has a large handwritten SQL query, it is nice to use named parameters, e.g. @StartTime. This change allows including these structs as parameters.

I didn't see any tests around parameters but happy to add some.

simonmcconnell avatar Dec 04 '23 04:12 simonmcconnell

Can you please add tests to test/ecto/adapters/tds_test.exs?

josevalim avatar Dec 04 '23 04:12 josevalim

Pardon my delay. I made prepare_params public as I couldn't see a public interface to unit test that part of the code with.

simonmcconnell avatar Mar 11 '24 02:03 simonmcconnell

@josevalim 👋

simonmcconnell avatar Apr 23 '24 21:04 simonmcconnell

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

josevalim avatar Apr 24 '24 07:04 josevalim