-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Closed
Description
Hi I checked the functionality that is provided by the Brackets class to assist the creation of complex conditions and it is awesome.
But there are a few issues
- Brackets is not exported, so it can not be used
- How can I use this in Join methods (innerJoin, joinandSelect etc) since we might have complex predicates there too.
- If (2) is not possible, can I create another queryBuilder to assist on the creation of the complex statement and then extract the SQL to use it in join method ?
Regarding (3) I noticed this code inside query builder
protected computeWhereParameter(where: string|((qb: this) => string)|Brackets) {
if (typeof where === "string")
return where;
if (where instanceof Brackets) {
const whereQueryBuilder = this.createQueryBuilder();
where.whereFactory(whereQueryBuilder as any);
const whereString = whereQueryBuilder.createWhereExpressionString();
this.setParameters(whereQueryBuilder.getParameters());
return whereString ? "(" + whereString + ")" : "";
}
return where(this);
}
Is this the appropriate way to create queryBuilders to construct partial statements and then somehow merge them with the main query builder ?
Can you direct me to such code if exists, since I create queries dynamically and I need such functionality in many places
Thanks
Metadata
Metadata
Assignees
Labels
No labels