Skip to content

feat: add UUID and ULID type support to SQLite grammar#22

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

feat: add UUID and ULID type support to SQLite grammar#22
hwbrzzl merged 5 commits intogoravel:masterfrom
ahmed3mar:feature/support-uuid

Conversation

@ahmed3mar
Copy link
Contributor

📑 Description

goravel/framework#1114

This pull request introduces support for two new column types, UUID and ULID, in the Grammar class and adds corresponding test cases to ensure their correct implementation. These changes enhance the database grammar's capabilities for handling these specific data types.

New Column Types Added:

  • grammar.go: Added methods TypeUuid and TypeUlid to the Grammar class to define the database representations for UUID (char(36)) and ULID (char(26)) column types.

Test Coverage:

  • grammar_test.go: Added test cases TestTypeUuid and TestTypeUlid in the GrammarSuite to validate the correct behavior of the TypeUuid and TypeUlid methods, ensuring they return the expected database column definitions.

✅ 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
@ahmed3mar ahmed3mar requested a review from a team as a code owner 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

Adds support for UUID and ULID column types to the SQLite grammar and covers them with unit tests.

  • Introduced TypeUuid and TypeUlid methods in grammar.go to return char(36) and char(26).
  • Added 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 1 comment.

File Description
grammar.go Added TypeUuid and TypeUlid to emit char types
grammar_test.go Added tests TestTypeUuid and 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 ☂️

hwbrzzl
hwbrzzl previously approved these changes Jul 5, 2025
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 👍

grammar.go Outdated
}

func (r *Grammar) TypeUuid(column driver.ColumnDefinition) string {
return "char(36)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be varchar

@hwbrzzl hwbrzzl dismissed their stale review July 5, 2025 14:12

left a tip

ahmed3mar and others added 2 commits July 6, 2025 09:51
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
Co-authored-by: Wenbo Han <hwbrzzl@gmail.com>
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 e712c7e into goravel:master Jul 6, 2025
5 checks passed
@ahmed3mar ahmed3mar deleted the feature/support-uuid branch July 6, 2025 15:52
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