Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi first thank you for working on this project ! Highly usable and nice API.
As mentioned in #666, ideally one would want to support true sql named binding. This change uses the already existing Variables, Bindings and NamedParameters, and adds DefineParameter used as shown in the unit tests
which now results in the generated SQL of
and importantly the named bindings only now occur once in the named bindings:
which does not happen with the variables. There should be no impact for the existing code as long as one does not use DefineParameter , all unit tests are passing including the mysql live tests. Added a docker-compose.yaml so people can easily test with the live database as done in the code. Not sure how was done before.
Note that this will not work with the standard WhereEnds etc functions as the sql syntax would not be '%@var' but '%' + @var . Considering that this feature is as you mention hidden and I have no need, at the moment, have not adjusted all those functions.
Let me know if you want to see any changes, would be happy to see this merged as I want to be able to do something like this for cursor based pagination (just for reference).
which works in my local version, obviously with more code and functions required.