Customize field column in generated code #1451
-
I want to create a generated Go from the database schema that looks like this :
is there a way to configure SQLBoiler.toml? because I want to generalize beforeHooks and afterHooks behaviors based on this custom type, for example :
thanks for reading my questions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I'm not 100% sure what you're trying to achieve. It seems you want to encrypt the email field. There are several possibilities: 1. Use a custom type in the generated modelYou can do this in the types configuration. https://github.com/volatiletech/sqlboiler?tab=readme-ov-file#types. NOTE: Make sure to do the encryption and decryption in the 2. Do it with hooksHere is the documentation on how to register hooks. https://github.com/volatiletech/sqlboiler?tab=readme-ov-file#hooks |
Beta Was this translation helpful? Give feedback.
Try adding this to your config.
Make sure to define the
Scan
andValue
methods on the type