TypeORM Synchronize Error: QueryFailedError: coercion should not try to coerce this value: BIT("")
#590
-
I'm encountering a very similar problem to #483 with TypeORM and PlanetScale, but a different error message. Offending SQL is further below.
Notes
Versions
Entities (Simple OneToMany / ManyToOne)
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { Workspace } from '~entities/workspace.entity';
@Entity()
export class Organization {
@PrimaryGeneratedColumn('increment')
organizationId: number;
@Column()
organizationName: string;
@OneToMany(() => Workspace, (workspace) => workspace.organization, {
createForeignKeyConstraints: false,
})
workspaces: Workspace[];
}
import {
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { Organization } from '~entities/organization.entity';
@Entity()
export class Workspace {
@PrimaryGeneratedColumn('increment')
workspaceId: number;
@Column()
workspaceName: string;
@ManyToOne(() => Organization, (organization) => organization.workspaces, {
createForeignKeyConstraints: false,
})
@JoinColumn({ name: 'organizationId' })
organization: Organization;
} Error
Raw SQL and Error (MySQL Workbench)
I really enjoy PlanetScale, but this is pretty crappy. Hoping there's some movement on this, unfortunately I'm going to need to look at Neon or DigitalOcean, or even just stick with RDS. Prisma works great with PlanetScale, but performance-wise, TypeORM is demonstrably faster. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hello @mikechabot, A TypeORM user receiving that specific coerce message is new to me as the errors mentioned in discussions#483 have been the more common ones reported. The remaining panic issue mentioned in that discussion was recently fixed last week: I am currently waiting on this fix to make its way into PlanetScale databases to provide an update to the users in the other discussion item so I'm hoping that this week's weekly Vitess release includes it so I can then share that with the others. Assuming that this last fix also helps to address the coerce issue you recently experienced too will be great but since it's a new report it's unclear whether this is something different. I've pulled up some details for your database, and have some things we can try out, but in order to simplify the back and forth required could you please write in to https://support.planetscale.com/ for me and we can begin to work more closely together on the issue you reported here? |
Beta Was this translation helpful? Give feedback.
Hello @mikechabot,
A TypeORM user receiving that specific coerce message is new to me as the errors mentioned in discussions#483 have been the more common ones reported.
The remaining panic issue mentioned in that discussion was recently fixed last week:
vitessio/vitess#14906
I am currently waiting on this fix to make its way into PlanetScale databases to provide an update to the users in the other discussion item so I'm hoping that this week's weekly Vitess release includes it so I can then share that with the others.
Assuming that this last fix also helps to address the coerce issue you recently experienced too will be great but since it's a new report it's unclear whether this is somet…