Error: QueryFailedError: VT12001: unsupported: LEFT JOIN with derived tables
#483
-
I am using PlanetScale with NestJS and TypeORM. I have two tables:
There is no relation between the two tables. However, when I try to run my code, I get this error in the terminal:
If I comment out |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 18 replies
-
Hello @ehteshamshahzad, Unfortunately, this is a current known issue with TypeORM and our Vitess layer. A partial fix is already implemented within PlanetScale, but the full fix won't be available until after Vitess 17 releases at the end of this month and from there it may take a little while for us to roll out Vitess 17 internally within PlanetScale's infrastructure. There is an unofficial TypeORM fork available that may be a bit out of date now that implements a workaround approach in the meanwhile if you're interested in having a more immediate option available if you're willing to try it. If not, aside from the other option of setting |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. I will continue using railway until this solution is resolved. Will we be notified @orware ? |
Beta Was this translation helpful? Give feedback.
-
Hi Guys, |
Beta Was this translation helpful? Give feedback.
-
Any update on this? I'm still getting this error. There is no relation between the two tables @orware |
Beta Was this translation helpful? Give feedback.
-
Hi @orware |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I'm still getting this error.. |
Beta Was this translation helpful? Give feedback.
-
I fired up a Hobby plan database yesterday and am experiencing the same issue. This is the logging output.
|
Beta Was this translation helpful? Give feedback.
-
I am experiencing this issue as well when I attempted to generate a new migration in typeorm. The workaround that I am using currently is to use a local MySQL instance for development along with typeorm: sync false, manually create migrations using typeorm migration:generate agains the local DB. From there I can switch configuration to our dev branch on Planetscale and run the migrations. |
Beta Was this translation helpful? Give feedback.
-
Hi, any updates on this. This has really become a bottleneck. |
Beta Was this translation helpful? Give feedback.
-
Any solutions? 🤧 |
Beta Was this translation helpful? Give feedback.
-
Also encountered this issue when trying to set-up vendure with planetscale. So I am currently need to look into alternatives. When this is fixed, I am happy to try it out again. |
Beta Was this translation helpful? Give feedback.
-
Same problem with TypeORM, but a different error message:
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
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.
Hello @ehteshamshahzad,
Unfortunately, this is a current known issue with TypeORM and our Vitess layer.
A partial fix is already implemented within PlanetScale, but the full fix won't be available until after Vitess 17 releases at the end of this month and from there it may take a little while for us to roll out Vitess 17 internally within PlanetScale's infrastructure.
There is an unofficial TypeORM fork available that may be a bit out of date now that implements a workaround approach in the meanwhile if you're interested in having a more immediate option available if you're willing to try it.
If not, aside from the other option of setting
synchronize: false
that you mentioned, the best r…