Custom getter/setter for model's property

Hi, are there any plans for custom getters? (like in TypeORM transformer)
4 Replies
bloberenober
bloberenober16mo ago
I'm not sure what it means
webcoder
webcoder16mo 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?
bloberenober
bloberenober16mo 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
webcoder16mo ago
Thanks a lot!