conditionType expression

This commit is contained in:
Jan Prochazka
2024-08-20 13:30:53 +02:00
parent 968e69c7f2
commit 49e338bbbc
2 changed files with 10 additions and 1 deletions

View File

@@ -68,6 +68,9 @@ export function dumpSqlCondition(dmp: SqlDumper, condition: Condition) {
dmp.put(' ^and ');
dumpSqlExpression(dmp, condition.right);
break;
case 'expression':
dumpSqlExpression(dmp, condition.expr);
break;
case 'in':
dumpSqlExpression(dmp, condition.expr);
dmp.put(' ^in (%,v)', condition.values);

View File

@@ -57,6 +57,11 @@ export interface UnaryCondition {
expr: Expression;
}
export interface ExpressionCondition extends UnaryCondition {
// not in standard SQL
conditionType: 'expression';
}
export interface BinaryCondition {
conditionType: 'binary';
operator: '=' | '!=' | '<>' | '<' | '>' | '>=' | '<=';
@@ -141,7 +146,8 @@ export type Condition =
| NotInCondition
| RawTemplateCondition
| AnyColumnPassEvalOnlyCondition
| SpecificPredicateCondition;
| SpecificPredicateCondition
| ExpressionCondition;
export interface Source {
name?: NamedObjectInfo;