sqltree: notIn support

This commit is contained in:
Jan Prochazka 2024-07-10 14:36:25 +02:00
parent 50b64cf0c6
commit 85a43c7a5b
2 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,10 @@ export function dumpSqlCondition(dmp: SqlDumper, condition: Condition) {
dumpSqlExpression(dmp, condition.expr);
dmp.put(' ^in (%,v)', condition.values);
break;
case 'notIn':
dumpSqlExpression(dmp, condition.expr);
dmp.put(' ^not ^in (%,v)', condition.values);
break;
case 'rawTemplate':
let was = false;
for (const item of condition.templateSql.split('$$')) {

View File

@ -106,6 +106,12 @@ export interface InCondition {
values: any[];
}
export interface NotInCondition {
conditionType: 'notIn';
expr: Expression;
values: any[];
}
export interface RawTemplateCondition {
conditionType: 'rawTemplate';
templateSql: string;
@ -127,6 +133,7 @@ export type Condition =
| NotExistsCondition
| BetweenCondition
| InCondition
| NotInCondition
| RawTemplateCondition
| AnyColumnPassEvalOnlyCondition;