JordanMarr / SqlHydra

SqlHydra is a suite of NuGet packages for working with databases in F# including code generation tools and query expressions.
MIT License
212 stars 20 forks source link

Some `where` property comparisons do not create a `QueryParameter` #70

Closed JordanMarr closed 8 months ago

JordanMarr commented 8 months ago

Property = comparisons all use KataUtils.getQueryParameterForValue function which checks for generated ProviderDbType attributes and then wraps the query parameter value in a QueryParameter type. This approach is good because it allows the query parameter to use the actual database column type instead of inferring a less specific column type.

The LinqExpressionVisitor is responsible for parsing the query expressions and creating where clause parameters.

Case where conditions that are not wrapping parameter values:

JordanMarr commented 8 months ago

Tried to wrap this parameter in a QueryParameter causes SqlKata to fail. Closing becase a LIKE query is going to trigger a table scan anyway, so the parameter type shouldn't matter here.