r-dbi / DBItest

Testing DBI drivers
http://dbitest.r-dbi.org
GNU Lesser General Public License v2.1
24 stars 18 forks source link

Support vector broadcasting for parameterized query #368

Open psychelzh opened 11 months ago

psychelzh commented 11 months ago

When specifying multiple parameters, if one of the parameters is a scalar and the others have the same length, it will be reasonable to expand that scalar to the same length as the other parameters.

krlmlr commented 11 months ago

Thanks, makes sense. As a workaround, you could now use as.data.frame(...) or as.list(as.data.frame(...)) :

as.data.frame(list(a = 1, b = 2:4))
#>   a b
#> 1 1 2
#> 2 1 3
#> 3 1 4

Created on 2023-11-05 with reprex v2.0.2