Skip to content

Add SQLite synchronous connection string option - #38812

Merged
AndriySvyryd merged 2 commits into
dotnet:mainfrom
AhmedSadek10:issue-38769-sqlite-synchronous
Sep 10, 2026
Merged

AndriySvyryd merged 2 commits into
dotnet:mainfrom
AhmedSadek10:issue-38769-sqlite-synchronous

Conversation

@AhmedSadek10

Copy link
Copy Markdown
Contributor
  • Add SqliteSynchronousMode and connection string support
  • Apply PRAGMA synchronous when opening connections
  • Add builder and connection tests

Fixes #38769

  • I've read the guidelines for contributing and seen the walkthrough
  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
  • The code builds and tests pass locally (also verified by our automated build checks)
  • Commit messages follow this format:
        Summary of the changes
        - Detail 1
        - Detail 2

        Fixes #bugnumber
  • Tests for the changes have been added (for bug fixes / features)
  • Code follows the same patterns and style as existing code in this repo

- Add SqliteSynchronousMode and connection string support
- Apply PRAGMA synchronous when opening connections
- Add builder and connection tests

Fixes dotnet#38769
@AhmedSadek10

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@AndriySvyryd
AndriySvyryd requested a balanced review from Copilot August 14, 2026 22:09
@AndriySvyryd AndriySvyryd self-assigned this Aug 14, 2026
@AndriySvyryd AndriySvyryd added this to the 12.0.0 milestone Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable SQLite synchronous modes through connection strings and applies them when connections open.

Changes:

  • Adds SqliteSynchronousMode and builder support.
  • Applies PRAGMA synchronous during connection opening.
  • Adds API baseline and unit-test coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
SqliteSynchronousMode.cs Defines supported synchronous modes.
SqliteConnectionStringBuilder.cs Adds the Synchronous option.
SqliteConnection.cs Applies the configured pragma.
Microsoft.Data.Sqlite.Core.baseline.json Records the new public API.
SqliteConnectionTest.cs Tests modes on non-pooled connections.
SqliteConnectionStringBuilderTest.cs Tests builder parsing and serialization.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

- Verify the native connection is reused after reopening
- Verify the configured synchronous mode is reapplied

@AndriySvyryd AndriySvyryd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@AndriySvyryd
AndriySvyryd merged commit fd0f112 into dotnet:main Sep 10, 2026
14 of 15 checks passed
@github-actions github-actions Bot added the api-review This PR or issue is introducing public API changes that need to be reviewed label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API review baseline changes for src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.baseline.json

Show diff

The diff below was generated by ApiChief between the base and the PR.

  class Microsoft.Data.Sqlite.SqliteConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
+ SqliteSynchronousMode? Synchronous { get; set; }
+ enum Microsoft.Data.Sqlite.SqliteSynchronousMode
+ const Microsoft.Data.Sqlite.SqliteSynchronousMode Extra
+ const Microsoft.Data.Sqlite.SqliteSynchronousMode Full
+ const Microsoft.Data.Sqlite.SqliteSynchronousMode Normal
+ const Microsoft.Data.Sqlite.SqliteSynchronousMode Off
+ SqliteSynchronousMode();

AndriySvyryd pushed a commit that referenced this pull request Sep 25, 2026
Fixes #38769

Co-authored-by: ahmed.abdelrahman <pc@SADEK>
@AndriySvyryd AndriySvyryd removed the api-review This PR or issue is introducing public API changes that need to be reviewed label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuring SQLite synchronous mode in the connection string

3 participants