Skip to content

Commit

Permalink
fix: condition is optional in SelectQueryBuilder joins (#7888)
Browse files Browse the repository at this point in the history
the condition seems to have been accidentally marked as required when
it's actually optional in the underlying implementation.  this marks
the condition in any join within `SelectQueryBuilder` as optional
  • Loading branch information
imnotjames committed Jul 11, 2021
1 parent 8ca05b1 commit 2deaa0e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/query-builder/SelectQueryBuilder.ts
Expand Up @@ -272,7 +272,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.join("INNER", entityOrProperty, alias, condition, parameters);
return this;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.join("LEFT", entityOrProperty, alias, condition, parameters);
return this;
}
Expand Down Expand Up @@ -350,7 +350,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.innerJoin(entityOrProperty, alias, condition, parameters);
return this;
Expand All @@ -376,7 +376,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndSelect(entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndSelect(entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table and adds all selection properties to SELECT.
Expand All @@ -390,7 +390,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.leftJoin(entityOrProperty, alias, condition, parameters);
return this;
Expand Down Expand Up @@ -423,7 +423,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -432,7 +432,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -441,7 +441,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("INNER", entityOrProperty, alias, condition, parameters, mapToProperty, true);
return this;
Expand Down Expand Up @@ -474,7 +474,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -483,7 +483,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -492,7 +492,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("INNER", entityOrProperty, alias, condition, parameters, mapToProperty, false);
return this;
Expand Down Expand Up @@ -525,7 +525,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -534,7 +534,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -543,7 +543,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("LEFT", entityOrProperty, alias, condition, parameters, mapToProperty, true);
return this;
Expand Down Expand Up @@ -576,7 +576,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -585,7 +585,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -594,7 +594,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("LEFT", entityOrProperty, alias, condition, parameters, mapToProperty, false);
return this;
Expand Down

0 comments on commit 2deaa0e

Please sign in to comment.