Skip to content

Skip SqliteConnection.Open in MA0042 and MA0045#1129

Merged
meziantou merged 1 commit intomainfrom
meziantou/skip-sqlite-open
May 5, 2026
Merged

Skip SqliteConnection.Open in MA0042 and MA0045#1129
meziantou merged 1 commit intomainfrom
meziantou/skip-sqlite-open

Conversation

@meziantou
Copy link
Copy Markdown
Owner

@meziantou meziantou commented May 5, 2026

SQLite in Microsoft.Data.Sqlite has documented async limitations, and SqliteConnection.Open() is effectively a synchronous API. Reporting MA0042/MA0045 for this call when SQLite special-cases are enabled produces noise.

This updates the shared blocking-call analyzer logic to treat SqliteConnection.Open() as a SQLite special-case alongside existing SQLite exemptions. The behavior is still configurable: when MA0042.enable_sqlite_special_cases = false, diagnostics are reported as before.

I also added regression tests for both MA0042 (async context) and MA0045 (non-async context) to cover enabled and disabled flag behavior, and updated the MA0042/MA0045 rule docs to list SqliteConnection.Open() in the SQLite special-case APIs.

Fix #1121 (comment)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meziantou meziantou merged commit 2673bc1 into main May 5, 2026
13 checks passed
@meziantou meziantou deleted the meziantou/skip-sqlite-open branch May 5, 2026 20:46
This was referenced May 5, 2026
This was referenced May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MA0045 shouldn't trigger on ADO.NET SQLite

1 participant