Skip to content

feat: [#358] Add some new Compile methods#27

Merged
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-17
Mar 8, 2025
Merged

feat: [#358] Add some new Compile methods#27
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-17

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 7, 2025

📑 Description

goravel/goravel#358

✅ Checks

  • Added test cases for my code

@hwbrzzl hwbrzzl marked this pull request as ready for review March 8, 2025 10:11
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 8, 2025 10:11
@hwbrzzl hwbrzzl requested a review from Copilot March 8, 2025 10:12
Copy link
Contributor

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.

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

@hwbrzzl hwbrzzl merged commit cc916a4 into master Mar 8, 2025
5 checks passed
@hwbrzzl hwbrzzl changed the title feat: [#358] Implement LockForUpdate method feat: [#358] Add some new Compile methods Mar 8, 2025
@hwbrzzl hwbrzzl deleted the bowen/#358-17 branch September 6, 2025 10:37
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.

2 participants