Compare commits
No commits in common. "3a01244199bbfa135a3187a3d24fecc038fb6218" and "eed8d36c0b57fdff10561aa3dd8ab4052cac5435" have entirely different histories.
3a01244199
...
eed8d36c0b
2 changed files with 1 additions and 20 deletions
|
@ -825,25 +825,7 @@ export class Handler {
|
||||||
}
|
}
|
||||||
builder.addCode(")");
|
builder.addCode(")");
|
||||||
return builder;
|
return builder;
|
||||||
},
|
|
||||||
coalesce: (handler: Handler, a: allModifierInput[]): QueryBuilder => {
|
|
||||||
const builder = new QueryBuilder();
|
|
||||||
builder.addCode("COALESCE(");
|
|
||||||
for (let i = 0; i < a.length; i++) {
|
|
||||||
const e = a[i];
|
|
||||||
if (e instanceof Attribute || e instanceof AttributeAlias) builder.addCode(e.getString());
|
|
||||||
else if (e instanceof Alias)
|
|
||||||
builder.addCode(handler.builders.escapeID(e.toString()));
|
|
||||||
else if (e instanceof Modifier || e instanceof selectQuery || e instanceof Aggregation) {
|
|
||||||
builder.append(e.serialize(handler));
|
|
||||||
} else {
|
|
||||||
builder.addInjection(e);
|
|
||||||
}
|
}
|
||||||
if (i < a.length - 1) builder.addCode(", ");
|
|
||||||
}
|
|
||||||
builder.addCode(")");
|
|
||||||
return builder;
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
datatypes = {
|
datatypes = {
|
||||||
|
|
|
@ -24,7 +24,6 @@ export const regexp = (a: allModifierInput, b: allModifierInput) => new BooleanM
|
||||||
export const exists = (q: selectQuery) => new BooleanModifier("exists", [q]);
|
export const exists = (q: selectQuery) => new BooleanModifier("exists", [q]);
|
||||||
|
|
||||||
export const concat = (...args: allModifierInput[]) => new StringModifier("concat", args);
|
export const concat = (...args: allModifierInput[]) => new StringModifier("concat", args);
|
||||||
export const coalesce = (...args: allModifierInput[]) => new StringModifier("coalesce", args);
|
|
||||||
|
|
||||||
//aggregations
|
//aggregations
|
||||||
export const count = (a: Attribute) => new Aggregation("count", a);
|
export const count = (a: Attribute) => new Aggregation("count", a);
|
||||||
|
|
Loading…
Reference in a new issue