DapperLib / DapperAOT

Build time tools in the flavor of Dapper
Other
349 stars 19 forks source link

[DAP231] False positive: Full table aggregation #81

Closed dotTrench closed 8 months ago

dotTrench commented 8 months ago

Describe the bug

When using an aggregation function e.g. MIN/MAX an a full table a false DAP231 warning is given

Dapper.Advisor: 1.0.10

To Reproduce

// DAP231: SELECT for single row without WHERE or (TOP and ORDER BY)
public static async Task<int> SelectMax(SqlConnection connection) =>
    await connection.QueryFirstOrDefaultAsync<int>("SELECT MAX(SomeColumn) FROM MyTable");
mgravell commented 8 months ago

D'oh, I should have thought of that. Thanks, great example.

mgravell commented 8 months ago

https://github.com/DapperLib/DapperAOT/releases/tag/1.0.16