Skip to content

Conversation

eygraber
Copy link
Owner

@eygraber eygraber commented Oct 6, 2025

  • foreign_key and synchronous only affect writes, so they aren't needed on reader connections
  • Also prevent use of connections before schema creation/migration

@eygraber eygraber requested a review from Copilot October 6, 2025 17:20
@eygraber eygraber self-assigned this Oct 6, 2025
@eygraber eygraber added the enhancement New feature or request label Oct 6, 2025
@eygraber eygraber enabled auto-merge (squash) October 6, 2025 17:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes SQLite connection configuration by separating PRAGMA settings between writer and reader connections. The changes ensure that foreign_key and synchronous PRAGMAs are only applied to writer connections since they only affect write operations, improving performance for reader connections.

  • Splits connection configuration into writer-specific and reader-specific setups
  • Updates API methods to distinguish between configuration updates and connection-specific PRAGMA execution
  • Adds logic to route certain PRAGMA queries to writer connections even outside transactions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ConnectionPool.kt Refactored interface to separate configuration updates from PRAGMA execution, added reader/writer-specific configuration methods
AndroidxSqliteDriver.kt Updated query routing logic to use writer connections for foreign_keys and synchronous PRAGMAs, modified setter methods to update configuration and execute PRAGMAs separately
AndroidxSqliteTransacterTest.kt Updated test implementation to match new ConnectionPool interface with renamed methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

  - foreign_key and synchronous only affect writes, so they aren't
    needed on reader connections
  - Also prevent use of connections before schema creation/migration
@eygraber eygraber merged commit c246e6e into master Oct 6, 2025
8 checks passed
@eygraber eygraber deleted the pragma-fixes branch October 6, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant