Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat #11: extend support for database ops via SQL driver #13

Merged

Conversation

ashwingopalsamy
Copy link
Contributor

Changes

With this PR, as highlighted in #11, we attempt to extend support for Go Database Drivers to use UUIDv8 in db operations.

@vtolstov - Please review and let me know your thoughts.

@ashwingopalsamy ashwingopalsamy added the feature A new feature or functionality to be added. label Dec 24, 2024
@ashwingopalsamy ashwingopalsamy self-assigned this Dec 24, 2024
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
unittests 89.94% <100.00%> (+1.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
uuidv8.go 88.00% <100.00%> (+2.40%) ⬆️

uuidv8.go Outdated Show resolved Hide resolved
uuidv8.go Outdated Show resolved Hide resolved
uuidv8.go Outdated

// Value implements the driver.Value interface for database writes.
func (u *UUIDv8) Value() (driver.Value, error) {
if u == nil || len(u.Node) != 6 {
Copy link
Contributor

Choose a reason for hiding this comment

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

For me the len(u.Node) != 6 should return an error, no?

But maybe I'm wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 💯 I've made the validation stricter here.

uuidv8.go Outdated Show resolved Hide resolved
@vtolstov
Copy link

works for me, thanks

@ashwingopalsamy ashwingopalsamy merged commit a206a17 into main Dec 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or functionality to be added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants