You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Having an embeddable defined like this @Embedded(() => Profile, { nullable: true }) and then assigning is null results in an error. This behaviour seems to be since v5.5, before this went fine.
Stack trace
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
at BetterSqlitePlatform.quoteIdentifier (/mikro-orm/packages/core/src/platforms/Platform.ts:347:26)
at /mikro-orm/packages/knex/src/AbstractSqlDriver.ts:329:68
at Array.map (<anonymous>)
at BetterSqliteDriver.nativeInsertMany (/mikro-orm/packages/knex/src/AbstractSqlDriver.ts:329:45)
at ChangeSetPersister.persistNewEntity (/mikro-orm/packages/core/src/unit-of-work/ChangeSetPersister.ts:107:35)
at ChangeSetPersister.executeInserts (/mikro-orm/packages/core/src/unit-of-work/ChangeSetPersister.ts:38:18)
at ChangeSetPersister.runForEachSchema (/mikro-orm/packages/core/src/unit-of-work/ChangeSetPersister.ts:86:42)
at ChangeSetPersister.executeInserts (/mikro-orm/packages/core/src/unit-of-work/ChangeSetPersister.ts:27:19)
at UnitOfWork.commitCreateChangeSets (/mikro-orm/packages/core/src/unit-of-work/UnitOfWork.ts:881:35)
at UnitOfWork.persistToDatabase (/mikro-orm/packages/core/src/unit-of-work/UnitOfWork.ts:819:7)
at BetterSqliteConnection.transactional (/mikro-orm/packages/knex/src/AbstractSqlConnection.ts:51:19)
at UnitOfWork.doCommit (/mikro-orm/packages/core/src/unit-of-work/UnitOfWork.ts:362:9)
at UnitOfWork.commit (/mikro-orm/packages/core/src/unit-of-work/UnitOfWork.ts:330:7)
at SqlEntityManager.flush (/mikro-orm/packages/core/src/EntityManager.ts:981:5)
at Object.<anonymous> (/mikro-orm/tests/issues/GH9999.test.ts:50:3)
When adding {object: true} to the Embedded it would work
Expected behavior
All columns in the table belonging to the Embeddable should get the null value. Or if you'd consider this the correct behaviour a better error message should be displayed indicating the problem.
Additional context
In v5.4.2 (bf35754) this did work
Versions
Dependency
Version
node
?
typescript
?
mikro-orm
5.5.x
your-driver
?
The text was updated successfully, but these errors were encountered:
Describe the bug
Having an embeddable defined like this
@Embedded(() => Profile, { nullable: true })
and then assigning isnull
results in an error. This behaviour seems to be since v5.5, before this went fine.Stack trace
To Reproduce
Steps to reproduce the behavior:
{object: true}
to the Embedded it would workExpected behavior
All columns in the table belonging to the Embeddable should get the null value. Or if you'd consider this the correct behaviour a better error message should be displayed indicating the problem.
Additional context
In v5.4.2 (bf35754) this did work
Versions
The text was updated successfully, but these errors were encountered: