DapperAOT
DapperAOT copied to clipboard
analyzer: Warn about potentially incorrect pseudo-positional arguments processing
Dapper.Vanilla will incorrectly process ? symbol assuming its a syntax for pseudo-positional arguments even when it is used in the SQL string. I.e:
select 'this ?looks? like pseudo-positional'
Added the processing step for StringLiteral in TSqlProcessor where we report a diagnostic only if criterias below are met:
- string contains 2 question marks
- string contains 2 question marks in
AsciiStringLiteralonly -
CompiledRegex.PseudoPositionalregex returns true
IIRC we decided not to report diagnostic for OLE Db smell check.
Closes #60
TODO:
- [x] detect specific SQL parse failure and ignore it\
- [x] overcome the warning
Parameter 'Id' is not used, but will be included -
- run PseudoPosArg regex after variables are assigned, and if there is something - mark it as used