Skip to content

chore: [#358] Move some interfaces related to grammar to the driver folder#936

Merged
hwbrzzl merged 1 commit intomasterfrom
bowen/#358-15
Mar 4, 2025
Merged

chore: [#358] Move some interfaces related to grammar to the driver folder#936
hwbrzzl merged 1 commit intomasterfrom
bowen/#358-15

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 4, 2025

📑 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

  • Added test cases for my code

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.16%. Comparing base (78106ed) to head (0f86866).

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.
📢 Have feedback on the report? Share it here.

@hwbrzzl hwbrzzl marked this pull request as ready for review March 4, 2025 09:31
Copilot AI review requested due to automatic review settings March 4, 2025 09:31
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 4, 2025 09:31
@hwbrzzl hwbrzzl merged commit f7dce3e into master Mar 4, 2025
9 of 11 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#358-15 branch March 4, 2025 09:33
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 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.

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.

3 participants