dbgate-sqltree
Advanced tools
Comparing version 4.1.9 to 4.1.10
@@ -63,4 +63,11 @@ "use strict"; | ||
break; | ||
case 'between': | ||
dumpSqlExpression_1.dumpSqlExpression(dmp, condition.expr); | ||
dmp.put(' ^between '); | ||
dumpSqlExpression_1.dumpSqlExpression(dmp, condition.left); | ||
dmp.put(' ^and '); | ||
dumpSqlExpression_1.dumpSqlExpression(dmp, condition.right); | ||
break; | ||
} | ||
} | ||
exports.dumpSqlCondition = dumpSqlCondition; |
@@ -35,4 +35,12 @@ "use strict"; | ||
break; | ||
case 'rowNumber': | ||
dmp.put(" ^row_number() ^over (^order ^by "); | ||
dmp.putCollection(', ', expr.orderBy, x => { | ||
dumpSqlExpression(dmp, x); | ||
dmp.put(' %k', x.direction); | ||
}); | ||
dmp.put(")"); | ||
break; | ||
} | ||
} | ||
exports.dumpSqlExpression = dumpSqlExpression; |
@@ -73,3 +73,9 @@ import { NamedObjectInfo, RangeDefinition, TransformType } from 'dbgate-types'; | ||
} | ||
export declare type Condition = BinaryCondition | NotCondition | TestCondition | CompoudCondition | LikeCondition | ExistsCondition | NotExistsCondition; | ||
export interface BetweenCondition { | ||
conditionType: 'between'; | ||
expr: Expression; | ||
left: Expression; | ||
right: Expression; | ||
} | ||
export declare type Condition = BinaryCondition | NotCondition | TestCondition | CompoudCondition | LikeCondition | ExistsCondition | NotExistsCondition | BetweenCondition; | ||
export interface Source { | ||
@@ -116,3 +122,7 @@ name?: NamedObjectInfo; | ||
} | ||
export declare type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression | CallExpression | TranformExpression; | ||
export interface RowNumberExpression { | ||
exprType: 'rowNumber'; | ||
orderBy: OrderByExpression[]; | ||
} | ||
export declare type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression | CallExpression | TranformExpression | RowNumberExpression; | ||
export declare type OrderByExpression = Expression & { | ||
@@ -119,0 +129,0 @@ direction: 'ASC' | 'DESC'; |
{ | ||
"version": "4.1.9", | ||
"version": "4.1.10", | ||
"name": "dbgate-sqltree", | ||
@@ -30,3 +30,3 @@ "main": "lib/index.js", | ||
"@types/node": "^13.7.0", | ||
"dbgate-types": "^4.1.9", | ||
"dbgate-types": "^4.1.10", | ||
"typescript": "^3.7.5" | ||
@@ -33,0 +33,0 @@ }, |
22386
605