feat: add UUID and ULID type support for SQL Server grammar#30
Merged
hwbrzzl merged 2 commits intogoravel:masterfrom Jul 5, 2025
Merged
feat: add UUID and ULID type support for SQL Server grammar#30hwbrzzl merged 2 commits intogoravel:masterfrom
hwbrzzl merged 2 commits intogoravel:masterfrom
Conversation
1 task
Contributor
There was a problem hiding this comment.
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
TypeUuidandTypeUlidmethods in theGrammarclass. - Adds
TestTypeUuidandTestTypeUlidto 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
TypeUuidto 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
TypeUlidto explain its mapping, e.g.,// TypeUlid maps a ULID column to SQL Server's nchar(26) type.
func (r *Grammar) TypeUlid(_ driver.ColumnDefinition) string {
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 introduces support for two new data types,
UUIDandULID, in theGrammarclass. Corresponding test cases have also been added to ensure the correct behavior of these new methods.Additions to
Grammarclass:TypeUuidmethod to mapUUIDto the database typeuniqueidentifier. (grammar.go, grammar.goR674-R681)TypeUlidmethod to mapULIDto the database typenchar(26). (grammar.go, grammar.goR674-R681)New test cases:
TestTypeUuidto validate thatTypeUuidcorrectly returnsuniqueidentifier. (grammar_test.go, grammar_test.goR727-R738)TestTypeUlidto validate thatTypeUlidcorrectly returnsnchar(26). (grammar_test.go, grammar_test.goR727-R738)✅ Checks