feat: add UUID and ULID column type support to MySQL grammar#45
Merged
hwbrzzl merged 2 commits intogoravel:masterfrom Jul 5, 2025
Merged
feat: add UUID and ULID column type support to MySQL grammar#45hwbrzzl merged 2 commits intogoravel:masterfrom
hwbrzzl merged 2 commits intogoravel:masterfrom
Conversation
1 task
There was a problem hiding this comment.
Pull Request Overview
This PR adds native support for UUID and ULID column types in the MySQL grammar by introducing two new type methods and corresponding unit tests.
- Introduces
TypeUuidandTypeUlidmethods ingrammar.goto returnchar(36)andchar(26). - Adds
TestTypeUuidandTestTypeUlidingrammar_test.goto verify the new methods.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| grammar.go | Added TypeUuid and TypeUlid methods |
| grammar_test.go | Added TestTypeUuid and TestTypeUlid unit tests |
Comments suppressed due to low confidence (5)
grammar.go:698
- [nitpick] Go convention recommends using uppercase initialisms for method names; consider renaming
TypeUuidtoTypeUUID.
func (r *Grammar) TypeUuid(_ driver.ColumnDefinition) string {
grammar.go:702
- [nitpick] Go convention recommends using uppercase initialisms for method names; consider renaming
TypeUlidtoTypeULID.
func (r *Grammar) TypeUlid(_ driver.ColumnDefinition) string {
grammar.go:698
- [nitpick] These exported methods lack doc comments; consider adding a brief comment above each to explain their purpose for Go doc.
func (r *Grammar) TypeUuid(_ driver.ColumnDefinition) string {
grammar_test.go:794
- [nitpick] Update test method name to
TestTypeUUIDto match the suggested method rename and follow initialism conventions.
func (s *GrammarSuite) TestTypeUuid() {
grammar_test.go:800
- [nitpick] Update test method name to
TestTypeULIDto match the suggested method rename and follow initialism conventions.
func (s *GrammarSuite) TestTypeUlid() {
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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/framework#1114
This pull request adds support for two new column types,
UUIDandULID, in theGrammarclass, along with corresponding unit tests to ensure their correct implementation.New column type support:
grammar.go: Added methodsTypeUuidandTypeUlidto theGrammarclass, which returnchar(36)andchar(26)respectively, to represent theUUIDandULIDcolumn types.Unit tests:
grammar_test.go: Added test methodsTestTypeUuidandTestTypeUlidto verify that theTypeUuidandTypeUlidmethods return the expected values (char(36)andchar(26)) when invoked.✅ Checks