Skip to content

feat: build IDs from UUIDs and scan native UUID values - #5

Merged
enilsen16 merged 3 commits into
mainfrom
feat/typed-uuid-access
Oct 22, 2026
Merged

enilsen16 merged 3 commits into
mainfrom
feat/typed-uuid-access

Conversation

@enilsen16

@enilsen16 enilsen16 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #4.

Summary

  • FromUUID[T](uuid.UUID) builds an ID through the type's Normalize and Validate. id.UUID() returns the bare value as a uuid.UUID. Callers that work with UUIDs then don't need to parse Bare() themselves. A zero ID fails with ErrEmptyValue, and a bare value that is not a UUID fails with ErrInvalidUUID.
  • Scan and DecodeSpanner also accept uuid.UUID and [16]byte, for drivers and Spanner columns that carry native UUIDs. A type with full storage rejects them with ErrInvalidFormat, because a native UUID has no prefix.

Tests

uuid_test.go and ExampleFromUUID cover these cases. CI runs only on PRs to main. Locally, go test -race, go vet and golangci-lint pass.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99ceece4-79ea-446c-998e-2d643c7a0829
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@enilsen16
enilsen16 added this pull request to stack #9 October 22, 2026 14:17
Base automatically changed from feat/named-types-and-checks to main October 22, 2026 16:08
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
@enilsen16
enilsen16 force-pushed the feat/typed-uuid-access branch from 658fd8c to c22f34b Compare October 22, 2026 16:08
@enilsen16
enilsen16 marked this pull request as ready for review October 22, 2026 16:09
@enilsen16
enilsen16 merged commit f4bf2de into main Oct 22, 2026
3 checks passed
@enilsen16
enilsen16 deleted the feat/typed-uuid-access branch October 22, 2026 16:19
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.

1 participant