chore: [#358] Move some interfaces related to grammar to the driver folder#936
Merged
chore: [#358] Move some interfaces related to grammar to the driver folder#936
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #936 +/- ##
=======================================
Coverage 69.16% 69.16%
=======================================
Files 157 157
Lines 10519 10519
=======================================
Hits 7275 7275
Misses 2911 2911
Partials 333 333 ☔ View full report in Codecov by Sentry. |
Contributor
There was a problem hiding this comment.
PR Overview
This PR refactors the project by moving several grammar‐related interfaces and types from the "schema" package to the "driver" package. In addition, it updates all affected files (including mocks, contracts, tests, and utility files) so that they reference the new driver interfaces and types instead of the old schema ones.
Reviewed Changes
| File | Description |
|---|---|
| mocks/database/driver/Blueprint.go | Generated mock for the Blueprint interface updated to use driver types. |
| contracts/database/driver/grammar.go | Moved the Grammar interface and related types (Schema, Blueprint, Command, etc.) to the driver package. |
| contracts/database/driver/processor.go | Updated the Processor interface and added types (ForeignKey, Index) to driver. |
| mocks/database/driver/Driver.go | Adjusted references in mock methods to use driver.Grammar and driver.Processor. |
| database/schema/column.go, index.go, utils.go | Updated function signatures and internal references from the old schema types to the new driver types. |
| contracts/database/driver/driver.go | Changed the return types of Grammar and Processor to the driver interfaces. |
| contracts/database/schema/blueprint.go | Updated blueprint methods to return driver.ColumnDefinition and related types. |
| database/schema/schema.go | Refactored schema functions to use driver types instead of schema types. |
| Test files (blueprint_test.go, utils_test.go, console commands tests) | Updated test dependencies, mocks, and assertions to reference driver types. |
| contracts/database/driver/column.go, mocks/database/driver/ColumnDefinition.go | Revised the column definitions and their mocks to use the driver package. |
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
almas-x
pushed a commit
that referenced
this pull request
Mar 12, 2025
almas-x
pushed a commit
that referenced
this pull request
Mar 18, 2025
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
The DB module needs to use the Grammar interface and add some new compiles for it, but the Grammar interface is in the schema folder now, it's not suitable in the latest logic, so move some interfaces related to grammar to the driver folder.
There is no logic change.
✅ Checks