Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1577 +/- ##
==========================================
+ Coverage 72.91% 73.27% +0.36%
==========================================
Files 412 412
Lines 26893 26906 +13
==========================================
+ Hits 19608 19716 +108
+ Misses 7283 7188 -95
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JGamboa
marked this pull request as ready for review
October 18, 2026 23:47
Contributor
Author
|
Review Ready |
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
Part of goravel/goravel#1000 (reading results section). Follows #1575. Roadmap: goravel/goravel#1015
Adds
Latest,ValueandDoesntExisttoorm.Query, with the same signatures asdb.Query:Latest(column ...string)isOrderByDesc, defaulting tocreated_atwhen no column (or an empty one) is given.DoesntExist()is!Exists(), so it respects global scopes and soft deletes.Value(column, dest):Select(column).Limit(1).Scan(dest).destreturnsDatabaseUnsupportedType.destuntouched, like the DB module.Retrieved, since it reads a raw column, likePluck/Sum.Found while testing, not changed here:
OrderByDesc("id").First()(and soLatest("id").First()) fails on SQL Server, because GORM appends a secondORDER BY idand the column ends up duplicated. It happens on master too. I can open an issue for it.✅ Checks
database/gorm.TestLatest,TestValue,TestDoesntExist, plusDoesntExist/Valuesubtests inTestGlobalScopes. They pass on Postgres, MySQL, SQLite and SQL Server.