Closed lun-4 closed 2 years ago
Hi,
thank you for working on this ! unfortunately I didn't have much time lately to review your PRs but I'll get around to it, probably in the coming weeks.
I like this feature, thanks for working on it ! Overall LGTM, only one small comment. With some tests I think it will be ok to merge.
As for this question:
Not sure how I should approach setting the field_name parameter to bindField, as it is comptime (so I'm just setting it to empty string). Any suggestions?
IIRC it's only used for debugging in comptime errors, in the case of a dynamic slice it's doesn't make sense so something like "unknown" is fine.
Looks good ! One last thing, could you remove the commit 9ef7561e02a0b4b08b13a6836202c0b13b509948 from the PR and then I can merge
When using
execDynamic
, you can have a runtime-known number of parameters in the query, however the current way of binding the parameters requires the values to be comptime-known.This PR allows slices of form
[]T
to be passed as thevalues
parameter, binding it to the statement with a runtime loop instead. Not sure how I should approach setting thefield_name
parameter to bindField, as it is comptime (so I'm just setting it to empty string). Any suggestions?This was manually tested, but if this idea moves forward on being upstreamed, I plan to add it to the test suite.