responses #8
2 changed files with 18 additions and 0 deletions
|
@ -708,6 +708,23 @@ export class Handler {
|
|||
}
|
||||
return builder;
|
||||
},
|
||||
regexp: (handler: Handler, a: allModifierInput[]): QueryBuilder => {
|
||||
const builder = new QueryBuilder();
|
||||
if (a[0] instanceof Attribute || a[0] instanceof AttributeAlias) builder.addCode(a[0].toString());
|
||||
else if (a[0] instanceof Modifier || a[0] instanceof selectQuery || a[0] instanceof Aggregation) {
|
||||
builder.append(a[0].serialize(handler));
|
||||
} else {
|
||||
builder.addInjection(a[0]);
|
||||
}
|
||||
builder.addCode(" REGEXP ");
|
||||
if (a[1] instanceof Attribute || a[1] instanceof AttributeAlias) builder.addCode(a[1].toString());
|
||||
else if (a[1] instanceof Modifier || a[1] instanceof selectQuery || a[1] instanceof Aggregation) {
|
||||
builder.append(a[1].serialize(handler));
|
||||
} else {
|
||||
builder.addInjection(a[1]);
|
||||
}
|
||||
return builder;
|
||||
},
|
||||
concat: (handler: Handler, a: allModifierInput[]): QueryBuilder => {
|
||||
const builder = new QueryBuilder();
|
||||
builder.addCode("CONCAT(");
|
||||
|
|
|
@ -18,6 +18,7 @@ export const divide = (...args: allModifierInput[]) => new NumberModifier("divid
|
|||
|
||||
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 concat = (...args: allModifierInput[]) => new StringModifier("concat", args);
|
||||
|
||||
|
|
Loading…
Reference in a new issue