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

use gorm serialiser instead of custom hooks #2156

Merged

Conversation

kradalby
Copy link
Collaborator

@kradalby kradalby commented Sep 27, 2024

This pr removes the custom types we have to wrap things to put them in the database, instead, we use gorm serialisers: https://gorm.io/docs/serializer.html.

We use the standard JSON serialiser and we introduce a Text serialiser that allows us to serialise types that implements: https://pkg.go.dev/encoding#TextMarshaler.

This allows us to remove even more custom code handling and a bunch of type casting/conversion.

@kradalby kradalby force-pushed the kradalby/gorm-serializer-no-custom-types branch 2 times, most recently from e691a12 to b0f67f5 Compare September 30, 2024 11:32
@kradalby kradalby changed the title test using gorm serialiser instead of custom hooks use gorm serialiser instead of custom hooks Sep 30, 2024
@kradalby kradalby force-pushed the kradalby/gorm-serializer-no-custom-types branch from a1d1233 to f93c63e Compare September 30, 2024 12:04
@kradalby kradalby marked this pull request as ready for review September 30, 2024 12:41
@kradalby kradalby force-pushed the kradalby/gorm-serializer-no-custom-types branch from f93c63e to ece488c Compare October 2, 2024 08:54
@kradalby kradalby merged commit bc9e83b into juanfont:main Oct 2, 2024
118 of 121 checks passed
@kradalby kradalby deleted the kradalby/gorm-serializer-no-custom-types branch October 2, 2024 09:42
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.

2 participants