exists
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
jusax23 2023-02-26 16:34:42 +01:00
parent 09d43f8f98
commit e446270591
2 changed files with 18 additions and 0 deletions

View file

@ -751,6 +751,22 @@ export class Handler {
}
return builder;
},
exists: (handler: Handler, a: allModifierInput[]):QueryBuilder =>{
let e = a[0];
if (e instanceof Attribute || e instanceof AttributeAlias) return new QueryBuilder([{ data: "exists (" + e.getString(handler) + ")" }])
if (e instanceof Modifier || e instanceof selectQuery || e instanceof Aggregation) {
const builder = new QueryBuilder();
builder.addCode("exists (");
builder.append(e.serialize(handler));
builder.addCode(")");
return builder;
}
return new QueryBuilder([
{ data: "exists (" },
{ inject: true, data: e },
{ data: ")" }
]);
},
concat: (handler: Handler, a: allModifierInput[]): QueryBuilder => {
const builder = new QueryBuilder();
builder.addCode("CONCAT(");

View file

@ -20,6 +20,8 @@ export const not = (arg: allModifierInput) => new BooleanModifier("not", [arg]);
export const like = (a: allModifierInput, b: allModifierInput) => new BooleanModifier("like", [a, b]);
export const regexp = (a: allModifierInput, b: allModifierInput) => new BooleanModifier("regexp", [a, b]);
export const exists = (q: selectQuery) => new BooleanModifier("exists", [q]);
export const concat = (...args: allModifierInput[]) => new StringModifier("concat", args);
//aggregations