Custom getter/setter for model's property

Hi, are there any plans for custom getters? (like in TypeORM transformer)
4 Replies
Dan
Dan2y ago
I'm not sure what it means
webcoder
webcoderOP2y ago
Sorry, I'll try to explain. I have decimal type of field in database(that returns as string) and want to transform it to other, like in this example. https://gist.github.com/lucky-libor/4aabcdb72532d681ad5bec8388d80fc3#file-money-1-ts Can I do it somehow in drizzle?
Dan
Dan2y ago
I see. For now, you can build a custom type with your own mapping logic - https://github.com/drizzle-team/drizzle-orm/blob/main/docs/custom-types.lite.md But this might be a nice feature to implement more easily, we'll think about it
webcoder
webcoderOP2y ago
Thanks a lot!
Want results from more Discord servers?
Add your server