-
Notifications
You must be signed in to change notification settings - Fork 0
Go/Xorm examples with separate go package for helper functions #16
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
Conversation
Json serialization for queries
Signed-off-by: fimac <fiona@cipherstash.com>
| // `type EncryptedTextFieldTwo string` | ||
| // | ||
| // - ToDB and FromDB needs to be implemented for each custom type. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a better way to do this.
I wanted to ensure that insert statements didn't need to be changed and only plaintext values were retrieved. Using the conversion interface allows us to convert from the go app type (e.g string) to the underlying db type (jsonb).
To do that, I needed to create a custom type, to then call the ToDb/FromDb method on.
The serialization/deserialization functions have been extracted to the goeql package currently sitting locally in the same folder (naming to tbc), so they can all be reused.
…anguage into test-creating-go-package
Go/Xorm examples with separate go package for helper functions
No description provided.