Skip to content

Conversation

eygraber
Copy link
Owner

@eygraber eygraber commented Oct 10, 2025

Fixes #121

  • Added new concurrency model system

    • Created AndroidxSqliteConcurrencyModel with multiple concurrency strategies
    • Added support for single reader/writer, multiple readers, and multiple readers with single writer patterns
    • Enhanced WAL mode support with configurable reader connection counts
  • Refactored driver architecture

    • Split AndroidxSqliteDriver into focused components:
      • AndroidxSqliteExecutingDriver - handles SQL execution
      • AndroidxSqliteDriverHolder - manages schema initialization and lifecycle
      • AndroidxSqliteConfigurableDriver - provides driver configuration
    • Improved separation of concerns and testability
  • Enhanced SQL handling and safety

    • Added AndroidxSqliteSpecialCase enum for special SQL operations
    • Created AndroidxSqliteUtils for SQL parsing and analysis
    • Improved journal mode setting with dedicated connection handling
    • Enhanced foreign key constraint validation
  • Improved connection pool management

    • Refactored ConnectionPool with better concurrency control
    • Added safer connection acquisition/release patterns
    • Enhanced transaction handling with proper connection isolation
  • Expanded test coverage

    • Added comprehensive ConnectionPoolTest suite
    • Added AndroidxSqliteUtilsTest for SQL parsing validation
    • Updated existing tests to work with new architecture
  • Documentation improvements

    • Updated README with new concurrency model documentation
    • Added detailed API documentation for new components

- **Added new concurrency model system**
  - Created `AndroidxSqliteConcurrencyModel` with multiple concurrency strategies
  - Added support for single reader/writer, multiple readers, and multiple readers with single writer patterns
  - Enhanced WAL mode support with configurable reader connection counts

- **Refactored driver architecture**
  - Split `AndroidxSqliteDriver` into focused components:
    - `AndroidxSqliteExecutingDriver` - handles SQL execution
    - `AndroidxSqliteDriverHolder` - manages schema initialization and lifecycle
    - `AndroidxSqliteConfigurableDriver` - provides driver configuration
  - Improved separation of concerns and testability

- **Enhanced SQL handling and safety**
  - Added `AndroidxSqliteSpecialCase` enum for special SQL operations
  - Created `AndroidxSqliteUtils` for SQL parsing and analysis
  - Improved journal mode setting with dedicated connection handling
  - Enhanced foreign key constraint validation

- **Improved connection pool management**
  - Refactored `ConnectionPool` with better concurrency control
  - Added safer connection acquisition/release patterns
  - Enhanced transaction handling with proper connection isolation

- **Expanded test coverage**
  - Added comprehensive `ConnectionPoolTest` suite
  - Added `AndroidxSqliteUtilsTest` for SQL parsing validation
  - Updated existing tests to work with new architecture

- **Documentation improvements**
  - Updated README with new concurrency model documentation
  - Added detailed API documentation for new components
@eygraber eygraber requested a review from Copilot October 10, 2025 05:43
@eygraber eygraber self-assigned this Oct 10, 2025
@eygraber eygraber added the enhancement New feature or request label Oct 10, 2025
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 introduces a major refactor that splits the monolithic AndroidxSqliteDriver into focused components, adds a new concurrency model system with enhanced WAL mode support, and improves SQL handling safety through specialized parsing and analysis utilities.

  • Refactored driver architecture into separate components for execution, lifecycle management, and configuration
  • Added new concurrency model system with support for single reader/writer, multiple readers, and multiple readers with single writer patterns
  • Enhanced SQL handling with specialized parsing utilities and safer journal mode configuration

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ConnectionPoolTest.kt Comprehensive test suite for new connection pool implementations and journal mode handling
AndroidxSqliteUtilsTest.kt Test coverage for SQL parsing and pragma detection utilities
AndroidxSqliteTransacterTest.kt Updated to use new driver architecture with connection factory pattern
AndroidxSqliteMigrationTest.kt Updated test expectations for error handling during migration failures
AndroidxSqliteCreationTest.kt Updated test expectations for error handling during creation failures
AndroidxSqliteConcurrencyTest.kt Updated to use new concurrency model configuration
ConnectionPool.kt Refactored with new concurrency model support and safer journal mode handling
AndroidxStatement.kt Extracted statement implementations from main driver file
AndroidxSqliteUtils.kt New utility for SQL parsing and pragma detection
AndroidxSqliteSpecialCase.kt Enum defining special SQL cases requiring specific handling
AndroidxSqliteExecutingDriver.kt New component focused on SQL execution and statement management
AndroidxSqliteDriverHolder.kt New component managing schema initialization and lifecycle
AndroidxSqliteDriver.kt Refactored main driver using new component architecture
AndroidxSqliteConfiguration.kt Updated with new concurrency model instead of simple reader count
AndroidxSqliteConfigurableDriver.kt Updated to work with generic SqlDriver interface
AndroidxSqliteConcurrencyModel.kt New sealed interface defining different concurrency strategies
AndroidxSqliteIntegrationTest.kt Updated to use new concurrency model configuration
AndroidxSqliteConcurrencyIntegrationTest.kt Updated to use new concurrency model configuration
README.md Comprehensive documentation update explaining new concurrency models

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

@eygraber eygraber merged commit 3160343 into master Oct 10, 2025
8 checks passed
@eygraber eygraber deleted the safer-concurrency branch October 10, 2025 05:58
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.

Crash: "Error code: 1, error in view View: no such table: main.Table"

1 participant