FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: `Decimal` type gets casted to `number` when queried through `with` (include relations)

Fresh12 months ago
Mar 14, 20260 views
Confidence Score80%
80%

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

Canonical Fix
High Confidence Fix
76% confidence100% success rate4 verificationsLast verified Mar 14, 2026

Solution: [BUG]: `Decimal` type gets casted to `number` when queried through `with` (include relations)

Low Risk

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...

76

Trust Score

4 verifications

100% success
  1. 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

Worked: 4
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptbugrqbpriority