[BUG]: `Decimal` type gets casted to `number` when queried through `with` (include relations)
Problem
What version of `drizzle-orm` are you using? 0.28.6 What version of `drizzle-kit` are you using? 0.19.13 Describe the Bug With those two tables and relations: [code block] If I query the `processesInputs` table directly, I get `percentage` as a string: [code block] But if I query the `processes` table including the related `processesInputs`, I get percentage as a number: [code block] Expected behavior I would expect `percentage` to be of type `string` in both cases Environment & setup _No response_
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: `Decimal` type gets casted to `number` when queried through `with` (include relations)
Same problem here. Numeric column value gets somehow transformed to `number` when accessed through `with`, but the type still says `string` (as it should be indeed). This is also problematic when precision is important...
Trust Score
4 verifications
- 1
Same problem here. Numeric column value gets somehow transformed to `number` whe
Same problem here. Numeric column value gets somehow transformed to `number` when accessed through `with`, but the type still says `string` (as it should be indeed). This is also problematic when precision is important...
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #1290. Community reactions: 5 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep