Skip to content

feat: add UUID and ULID column type support to MySQL grammar#45

Merged
hwbrzzl merged 2 commits intogoravel:masterfrom
ahmed3mar:feature/support-uuid
Jul 5, 2025
Merged

feat: add UUID and ULID column type support to MySQL grammar#45
hwbrzzl merged 2 commits intogoravel:masterfrom
ahmed3mar:feature/support-uuid

Conversation

@ahmed3mar
Copy link
Contributor

@ahmed3mar ahmed3mar commented Jul 5, 2025

📑 Description

goravel/framework#1114

This pull request adds support for two new column types, UUID and ULID, in the Grammar class, along with corresponding unit tests to ensure their correct implementation.

New column type support:

  • grammar.go: Added methods TypeUuid and TypeUlid to the Grammar class, which return char(36) and char(26) respectively, to represent the UUID and ULID column types.

Unit tests:

  • grammar_test.go: Added test methods TestTypeUuid and TestTypeUlid to verify that the TypeUuid and TypeUlid methods return the expected values (char(36) and char(26)) when invoked.

✅ Checks

  • Added test cases for my code

@ahmed3mar ahmed3mar marked this pull request as ready for review July 5, 2025 00:29
Copilot AI review requested due to automatic review settings July 5, 2025 00:29
@ahmed3mar ahmed3mar requested a review from a team as a code owner July 5, 2025 00:29
Copy link

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.

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 TypeUuid and TypeUlid methods in grammar.go to return char(36) and char(26).
  • Adds TestTypeUuid and TestTypeUlid in grammar_test.go to 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 TypeUuid to TypeUUID.
func (r *Grammar) TypeUuid(_ driver.ColumnDefinition) string {

grammar.go:702

  • [nitpick] Go convention recommends using uppercase initialisms for method names; consider renaming TypeUlid to TypeULID.
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 TestTypeUUID to match the suggested method rename and follow initialism conventions.
func (s *GrammarSuite) TestTypeUuid() {

grammar_test.go:800

  • [nitpick] Update test method name to TestTypeULID to match the suggested method rename and follow initialism conventions.
func (s *GrammarSuite) TestTypeUlid() {

@codecov-commenter
Copy link

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 ☂️

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@hwbrzzl hwbrzzl merged commit 91b1421 into goravel:master Jul 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants