Custom getter/setter for model's property
Hi, are there any plans for custom getters? (like in TypeORM
transformer
)4 Replies
I'm not sure what it means
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?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
Thanks a lot!