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 '); dmp.put(' ^and ');
dumpSqlExpression(dmp, condition.right); dumpSqlExpression(dmp, condition.right);
break; break;
case 'expression':
dumpSqlExpression(dmp, condition.expr);
break;
case 'in': case 'in':
dumpSqlExpression(dmp, condition.expr); dumpSqlExpression(dmp, condition.expr);
dmp.put(' ^in (%,v)', condition.values); dmp.put(' ^in (%,v)', condition.values);

View File

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