Skip to content

feat: add UUID and ULID type support in grammar#56

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

feat: add UUID and ULID type support in grammar#56
hwbrzzl merged 2 commits intogoravel:masterfrom
ahmed3mar:feature/support-uuid

Conversation

@ahmed3mar
Copy link
Contributor

📑 Description

Related: goravel/framework#1114

This pull request introduces support for two new database column types, uuid and ulid, in the Grammar class, along with corresponding unit tests to ensure their correctness.

Added support for new column types:

  • grammar.go: Added methods TypeUuid and TypeUlid to the Grammar class to define the database column types uuid and char(26) respectively.

Added unit tests for new column types:

  • grammar_test.go: Added test cases TestTypeUuid and TestTypeUlid in the GrammarSuite to verify the correct mapping of the uuid and ulid column types.

✅ Checks

  • Added test cases for my code

@ahmed3mar ahmed3mar marked this pull request as ready for review July 5, 2025 00:27
Copilot AI review requested due to automatic review settings July 5, 2025 00:27
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.

Pull Request Overview

This PR adds support for UUID and ULID column types in the Grammar class and includes unit tests to verify their generated SQL types.

  • Introduces TypeUuid and TypeUlid methods in grammar.go.
  • Adds TestTypeUuid and TestTypeUlid in grammar_test.go to cover the new types.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
grammar.go Added TypeUuid (returns "uuid") and TypeUlid (returns "char(26)") methods.
grammar_test.go Added TestTypeUuid and TestTypeUlid to ensure correct SQL type mappings.
Comments suppressed due to low confidence (1)

grammar.go:780

  • [nitpick] Consider adding a doc comment above this method to explain its purpose and ensure consistency with existing method documentation.
func (r *Grammar) TypeUuid(column driver.ColumnDefinition) string {

@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 0e7bf0a 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