Skip to content

[BUG]: drizzle-kit pull, fails using mssql dialect when decimal is null #5726

@rtncdevs

Description

@rtncdevs

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0-beta.22

What version of drizzle-kit are you using?

1.0.0-beta.22

Other packages

No response

Describe the Bug

Using "npx drizzle-kit pull" gave this error.

Cannot read properties of null (reading 'replace')
TypeError: Cannot read properties of null (reading 'replace')
at Object.defaultFromIntrospect (C:\Data\VisualStudio\Projects\NODEJS\ncs-node-express-hr-data\node_modules\drizzle-kit\bin.cjs:31733:22)
at parseDefault$1 (C:\Data\VisualStudio\Projects\NODEJS\ncs-node-express-hr-data\node_modules\drizzle-kit\bin.cjs:31483:26)
at fromDatabase (C:\Data\VisualStudio\Projects\NODEJS\ncs-node-express-hr-data\node_modules\drizzle-kit\bin.cjs:241551:14)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async fromDatabaseForDrizzle (C:\Data\VisualStudio\Projects\NODEJS\ncs-node-express-hr-data\node_modules\drizzle-kit\bin.cjs:241617:15)

Using AI chat mode, it purports to fix the error by including a null guard inside Decimal.defaultFromInspect, after trying the non-beta version of drizzle-kit, and and the latest RC versions. I've not included the patch, as I'm unsure whether it's just fixing a local issue, or whether there are wider issues are play.

After applying the fix the pull migration ran, and a schema was created, I've not explored whether the schema is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions