We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryBuilder update function use different table name on where phrase.
Database : SQLite
Entity definition
@Entity({ name: 'inventory_material' }) export default class MaterialEntity extends BaseEntity implements EntityInterface { @PrimaryGeneratedColumn({ name: 'id', type: 'int' }) public id: number; @Column({ name: 'name', type: 'varchar', length: 255, nullable: false, unique: true }) @Length(1, 255) public name: string; @Column({ name: 'image_url', type: 'varchar', length: 1024, nullable: true, default: null }) public imageUrl: string | null; public stringify(): string { return `${this.id}_${this.name}`; } }
Note that I use custom table name instead of Entity class name
Expected query #1 - Alias given on QueryBuilder by materialRepo.createQueryBuilder('material')
materialRepo.createQueryBuilder('material')
UPDATE "inventory_material" SET "name" = ? WHERE id = 28
#1 - Alias given on QueryBuilder by materialRepo.createQueryBuilder('material')
UPDATE "inventory_material" SET "name" = ? WHERE material.id = 28
#2 - Alias not given
UPDATE "inventory_material" SET "name" = ? WHERE MaterialEntity.id = 28
Both use wrong table name on where phrase
let qb: QueryBuilder<MaterialEntity> = this.materialRepo.createQueryBuilder().where({id: materialId}); if (dto.name !== undefined) qb = qb.update({name: dto.name}); await qb.execute();
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue description
QueryBuilder update function use different table name on where phrase.
Expected Behavior
Database : SQLite
Entity definition
Note that I use custom table name instead of Entity class name
Expected query
#1 - Alias given on QueryBuilder by
materialRepo.createQueryBuilder('material')
Actual Behavior
#1 - Alias given on QueryBuilder by
materialRepo.createQueryBuilder('material')
#2 - Alias not given
Both use wrong table name on where phrase
Steps to reproduce
My Environment
Additional Context
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered: