Skip to content

nativeInsert default value does not account for nullability #6879

@adrien2p

Description

@adrien2p

Describe the bug

When creating a new entity and flushing it, the parameters are generated without respecting the property’s nullability configuration. As a result, if a property is defined as nullable and null is explicitly provided, the ORM instead assigns the default value. This causes a behavioral discrepancy compared to previous versions.

Reproduction

I am opening a pr to solve this issues which will have the reproduction included

What driver are you using?

@mikro-orm/postgresql

MikroORM version

6.5.5

Node.js version

22+

Operating system

mac os sequoia

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions