Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR implements the LockForUpdate feature along with related locking and ordering functionalities for both standard queries and Gorm. Key changes include:
- Adding new methods to compile lock (FOR UPDATE/SHARE) and random order clauses in Grammar.
- Updating Postgres' Gorm method signature to remove the unused query return value.
- Removing the redundant query.go file that previously provided lock and random order methods.
Reviewed Changes
| File | Description |
|---|---|
| grammar.go | Added methods for handling lock and random order clauses. |
| postgres.go | Updated Gorm method signature to return only *gorm.DB, error. |
| query.go | Removed the obsolete Query struct and associated locking methods. |
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
postgres.go:79
- The change in the Gorm method's return signature (removing the second value) could impact any callers expecting the previous driver.GormQuery. Please confirm all dependent code has been updated accordingly.
func (r *Postgres) Gorm() (*gorm.DB, error) {
query.go:1
- The entire query.go file has been removed. Please ensure that all scenarios previously covered by its locking and random ordering methods are now adequately covered by tests using the new Grammar methods.
package postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📑 Description
goravel/goravel#358
✅ Checks