Skip to content

feat: add UUID and ULID type support for SQL Server grammar#30

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

feat: add UUID and ULID type support for SQL Server grammar#30
hwbrzzl merged 2 commits intogoravel:masterfrom
ahmed3mar:feature/support-uuid

Conversation

@ahmed3mar
Copy link
Contributor

📑 Description

goravel/framework#1114

This pull request introduces support for two new data types, UUID and ULID, in the Grammar class. Corresponding test cases have also been added to ensure the correct behavior of these new methods.

Additions to Grammar class:

  • Added TypeUuid method to map UUID to the database type uniqueidentifier. (grammar.go, grammar.goR674-R681)
  • Added TypeUlid method to map ULID to the database type nchar(26). (grammar.go, grammar.goR674-R681)

New test cases:

  • Added TestTypeUuid to validate that TypeUuid correctly returns uniqueidentifier. (grammar_test.go, grammar_test.goR727-R738)
  • Added TestTypeUlid to validate that TypeUlid correctly returns nchar(26). (grammar_test.go, grammar_test.goR727-R738)

✅ 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
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 SQL Server grammar and provides unit tests to verify their mappings.

  • Introduces TypeUuid and TypeUlid methods in the Grammar class.
  • Adds TestTypeUuid and TestTypeUlid to ensure correct return values.

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 returning SQL Server native types.
grammar_test.go Added unit tests TestTypeUuid and TestTypeUlid.
Comments suppressed due to low confidence (2)

grammar.go:674

  • Consider adding a doc comment above TypeUuid to describe its purpose, e.g., // TypeUuid maps a UUID column to SQL Server's uniqueidentifier type.
func (r *Grammar) TypeUuid(_ driver.ColumnDefinition) string {

grammar.go:678

  • Consider adding a doc comment above TypeUlid to explain its mapping, e.g., // TypeUlid maps a ULID column to SQL Server's nchar(26) type.
func (r *Grammar) TypeUlid(_ 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 0a380a0 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