Skip to content

Continue API improvement #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 9, 2025
Merged

Conversation

antonkomarev
Copy link
Member

No description provided.

@antonkomarev antonkomarev requested a review from Copilot August 9, 2025 07:32
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 refactors the PostgreSQL advisory lock API to improve consistency and usability. The main focus is on improving method naming, variable naming consistency, and simplifying the API surface.

  • Renames variables and parameters for consistency (postgresLockIdlockKey, postgresLockKey)
  • Removes the TransactionLevelLockHandle class and simplifies transaction-level lock acquisition
  • Adds a new withinSessionLevelLock method for safer session-level lock handling with automatic cleanup

Reviewed Changes

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

Show a summary per file
File Description
test/Unit/Postgres/PostgresLockKeyTest.php Updates test method and data provider names to use consistent "LockKey" terminology
test/Integration/Postgres/PostgresAdvisoryLockerTest.php Updates variable names and adapts tests to new API changes including lock handle property access
test/Integration/AbstractIntegrationTestCase.php Renames parameters and improves lock mode matching logic
src/Postgres/PostgresAdvisoryLocker.php Major API refactoring: removes handler methods, adds withinSessionLevelLock, simplifies parameter names
src/Postgres/LockHandle/TransactionLevelLockHandle.php Removes entire file as part of API simplification
src/Postgres/LockHandle/SessionLevelLockHandle.php Updates property name and removes automatic destructor cleanup
src/Postgres/Enum/PostgresLockWaitModeEnum.php Reorders documentation comments
src/Postgres/Enum/PostgresLockLevelEnum.php Reorders enum cases and documentation
src/Postgres/Enum/PostgresLockAccessModeEnum.php Removes string values from enum, simplifying to basic enum cases
README.md Updates documentation to reflect API changes and adds new callback-based usage examples

@antonkomarev antonkomarev merged commit 60085ad into master Aug 9, 2025
2 checks passed
@antonkomarev antonkomarev deleted the hotfix_leave-only-handler-api branch August 9, 2025 07:36
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.

1 participant