Skip to content

Need a setting to disable unreliable OLEDB parameter check #1971

@StruanT

Description

@StruanT

The smellsLikeOleDb regex on SqlMapper doesn't work correctly in all kinds of scenarios. If you are passing a model that has properties that you don't intend to parameterize and cannot be parameterized this results in a NotSupportedException

I think this would most easily solved by having a setting turn it off on this line (just make filterParams true and ignore this regex if a setting is enabled)

filterParams = !smellsLikeOleDb.IsMatch(identity.sql);

Some examples that break this "smell check".

This would all be solved by having a way to turn it off (make filterParams true and ignore this regex)

I see no reason not to have the option to disable this footgun completely for anyone not using OLEDB at all. For that matter... why not default it to off and let anyone using OLEDB turn it on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions