Skip to content

DAP026 when using union all #152

@zsr2531

Description

@zsr2531

Describe the bug

I am getting a false positive DAP026 error when my query contains an union all.

Where are you seeing this?

  • what Dapper/Dapper.StrongName version? 2.1.66
  • what Dapper.AOT/Dapper.Advisor version? 1.0.48
  • if relevant: what database backend? Sql server (Microsoft.Data.SqlClient 6.0.1)

To Reproduce
Example code; SQL/C# as appropriate

await db.QueryAsync<int>(
    """
    select 1
    union all
    select 2
    """
);

Observe that this error gets reported: The command lacks a query[DAP026](https://aot.dapperlib.dev/rules/DAP026), and the application doesn't build anymore.

Expected behavior
No errors are reported since the command is correct.

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