Numeric
``
I'm working with Drizzle ORM and have a numeric column defined like this:
The problem is that Drizzle expects string values for numeric fields (like "19.99" instead of 19.99), which is inconvenient for my application code. I want to handle numbers natively in my JavaScript/TypeScript code.
I'd like to implement a custom mapper solution that:
1. Allows me to use native numbers in my application code
2. Automatically converts to strings when sending to the database
3. Automatically converts back to numbers when querying
Can you provide a working example of how to properly implement custom mappers for numeric fields in Drizzle ORM with the latest syntax? I need specific code that shows exactly how to define and apply the mapper to my schema.
0 Replies