@itwin/ecsql-common 5.0.0-dev.3 → 5.0.0-dev.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/ECSqlAst.js +67 -67
- package/lib/cjs/ECSqlAst.js.map +1 -1
- package/lib/esm/ECSqlAst.js +67 -67
- package/lib/esm/ECSqlAst.js.map +1 -1
- package/package.json +6 -6
package/lib/esm/ECSqlAst.js
CHANGED
|
@@ -247,6 +247,7 @@ export class ComputedExpr extends Expr {
|
|
|
247
247
|
* @alpha
|
|
248
248
|
*/
|
|
249
249
|
export class BooleanExpr extends ComputedExpr {
|
|
250
|
+
static { this.deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.BooleanFactor, NativeExpIds.SubqueryTest, NativeExpIds.AllOrAny, NativeExpIds.BooleanFactor]; }
|
|
250
251
|
static deserialize(node) {
|
|
251
252
|
if (node.id === NativeExpIds.BinaryBoolean) {
|
|
252
253
|
const op = node.op;
|
|
@@ -282,7 +283,6 @@ export class BooleanExpr extends ComputedExpr {
|
|
|
282
283
|
throw new Error(`Unknown type of native value exp ${node.id}`);
|
|
283
284
|
}
|
|
284
285
|
}
|
|
285
|
-
BooleanExpr.deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.BooleanFactor, NativeExpIds.SubqueryTest, NativeExpIds.AllOrAny, NativeExpIds.BooleanFactor];
|
|
286
286
|
/**
|
|
287
287
|
* Base class for all value expressions. Following is list of subclasses.
|
|
288
288
|
* @see [[SubqueryExpr]]
|
|
@@ -299,6 +299,19 @@ BooleanExpr.deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.Boolea
|
|
|
299
299
|
* @alpha
|
|
300
300
|
*/
|
|
301
301
|
export class ValueExpr extends ComputedExpr {
|
|
302
|
+
static { this.deserializableIds = [
|
|
303
|
+
NativeExpIds.LiteralValue,
|
|
304
|
+
NativeExpIds.Parameter,
|
|
305
|
+
NativeExpIds.FunctionCall,
|
|
306
|
+
NativeExpIds.Cast,
|
|
307
|
+
NativeExpIds.BinaryValue,
|
|
308
|
+
NativeExpIds.SearchCaseValue,
|
|
309
|
+
NativeExpIds.IIF,
|
|
310
|
+
NativeExpIds.UnaryValue,
|
|
311
|
+
NativeExpIds.PropertyName,
|
|
312
|
+
NativeExpIds.Subquery,
|
|
313
|
+
NativeExpIds.NavValueCreationFunc,
|
|
314
|
+
]; }
|
|
302
315
|
static deserialize(node) {
|
|
303
316
|
if (node.id === NativeExpIds.UnaryValue) {
|
|
304
317
|
return UnaryValueExpr.deserialize(node);
|
|
@@ -335,19 +348,6 @@ export class ValueExpr extends ComputedExpr {
|
|
|
335
348
|
throw new Error(`Unknown type of native value exp ${node.id}`);
|
|
336
349
|
}
|
|
337
350
|
}
|
|
338
|
-
ValueExpr.deserializableIds = [
|
|
339
|
-
NativeExpIds.LiteralValue,
|
|
340
|
-
NativeExpIds.Parameter,
|
|
341
|
-
NativeExpIds.FunctionCall,
|
|
342
|
-
NativeExpIds.Cast,
|
|
343
|
-
NativeExpIds.BinaryValue,
|
|
344
|
-
NativeExpIds.SearchCaseValue,
|
|
345
|
-
NativeExpIds.IIF,
|
|
346
|
-
NativeExpIds.UnaryValue,
|
|
347
|
-
NativeExpIds.PropertyName,
|
|
348
|
-
NativeExpIds.Subquery,
|
|
349
|
-
NativeExpIds.NavValueCreationFunc,
|
|
350
|
-
];
|
|
351
351
|
/**
|
|
352
352
|
* Base class for expressions that can be used in FROM clause of a SELECT. Following list of this subclasses.
|
|
353
353
|
* @see [[ClassRefExpr]]
|
|
@@ -360,6 +360,13 @@ ValueExpr.deserializableIds = [
|
|
|
360
360
|
* @alpha
|
|
361
361
|
*/
|
|
362
362
|
export class ClassRefExpr extends Expr {
|
|
363
|
+
static { this.deserializableIds = [
|
|
364
|
+
NativeExpIds.ClassName,
|
|
365
|
+
NativeExpIds.SubqueryRef,
|
|
366
|
+
NativeExpIds.UsingRelationshipJoinExp,
|
|
367
|
+
NativeExpIds.QualifiedJoin,
|
|
368
|
+
NativeExpIds.CommonTableBlockName,
|
|
369
|
+
]; }
|
|
363
370
|
static deserialize(node) {
|
|
364
371
|
if (node.id === NativeExpIds.ClassName) {
|
|
365
372
|
return ClassNameExpr.deserialize(node);
|
|
@@ -382,13 +389,6 @@ export class ClassRefExpr extends Expr {
|
|
|
382
389
|
throw new Error(`Unknown type of native value exp ${node.id}`);
|
|
383
390
|
}
|
|
384
391
|
}
|
|
385
|
-
ClassRefExpr.deserializableIds = [
|
|
386
|
-
NativeExpIds.ClassName,
|
|
387
|
-
NativeExpIds.SubqueryRef,
|
|
388
|
-
NativeExpIds.UsingRelationshipJoinExp,
|
|
389
|
-
NativeExpIds.QualifiedJoin,
|
|
390
|
-
NativeExpIds.CommonTableBlockName,
|
|
391
|
-
];
|
|
392
392
|
/**
|
|
393
393
|
* Write expression tree to string
|
|
394
394
|
* @alpha
|
|
@@ -492,6 +492,7 @@ export class ECSqlWriter {
|
|
|
492
492
|
* @alpha
|
|
493
493
|
*/
|
|
494
494
|
export class DerivedPropertyExpr extends Expr {
|
|
495
|
+
static { this.type = ExprType.DerivedProperty; }
|
|
495
496
|
constructor(computedExpr, alias) {
|
|
496
497
|
super(DerivedPropertyExpr.type);
|
|
497
498
|
this.computedExpr = computedExpr;
|
|
@@ -514,12 +515,12 @@ export class DerivedPropertyExpr extends Expr {
|
|
|
514
515
|
}
|
|
515
516
|
}
|
|
516
517
|
}
|
|
517
|
-
DerivedPropertyExpr.type = ExprType.DerivedProperty;
|
|
518
518
|
/**
|
|
519
519
|
* Describes a ECSQL delete statement.
|
|
520
520
|
* @alpha
|
|
521
521
|
*/
|
|
522
522
|
export class DeleteStatementExpr extends StatementExpr {
|
|
523
|
+
static { this.type = ExprType.DeleteStatement; }
|
|
523
524
|
constructor(className, where, options) {
|
|
524
525
|
super(DeleteStatementExpr.type);
|
|
525
526
|
this.className = className;
|
|
@@ -559,12 +560,12 @@ export class DeleteStatementExpr extends StatementExpr {
|
|
|
559
560
|
}
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
|
-
DeleteStatementExpr.type = ExprType.DeleteStatement;
|
|
563
563
|
/**
|
|
564
564
|
* Describe a ECSQL Insert statement.
|
|
565
565
|
* @alpha
|
|
566
566
|
*/
|
|
567
567
|
export class InsertStatementExpr extends StatementExpr {
|
|
568
|
+
static { this.type = ExprType.InsertStatement; }
|
|
568
569
|
constructor(className, values, propertyNames) {
|
|
569
570
|
super(InsertStatementExpr.type);
|
|
570
571
|
this.className = className;
|
|
@@ -622,12 +623,12 @@ export class InsertStatementExpr extends StatementExpr {
|
|
|
622
623
|
writer.append(")");
|
|
623
624
|
}
|
|
624
625
|
}
|
|
625
|
-
InsertStatementExpr.type = ExprType.InsertStatement;
|
|
626
626
|
/**
|
|
627
627
|
* Describes a JOIN clause e.g. <classNameExpr> JOIN <classNameExpr> ON <joinspec>
|
|
628
628
|
* @alpha
|
|
629
629
|
*/
|
|
630
630
|
export class QualifiedJoinExpr extends ClassRefExpr {
|
|
631
|
+
static { this.type = ExprType.QualifiedJoin; }
|
|
631
632
|
constructor(joinType, from, to, spec) {
|
|
632
633
|
super(QualifiedJoinExpr.type);
|
|
633
634
|
this.joinType = joinType;
|
|
@@ -703,12 +704,12 @@ export class QualifiedJoinExpr extends ClassRefExpr {
|
|
|
703
704
|
}
|
|
704
705
|
}
|
|
705
706
|
}
|
|
706
|
-
QualifiedJoinExpr.type = ExprType.QualifiedJoin;
|
|
707
707
|
/**
|
|
708
708
|
* Describe a JOIN USING clause.
|
|
709
709
|
* @alpha
|
|
710
710
|
*/
|
|
711
711
|
export class UsingRelationshipJoinExpr extends ClassRefExpr {
|
|
712
|
+
static { this.type = ExprType.UsingRelationshipJoin; }
|
|
712
713
|
constructor(fromClassName, toClassName, toRelClassName, direction) {
|
|
713
714
|
super(UsingRelationshipJoinExpr.type);
|
|
714
715
|
this.fromClassName = fromClassName;
|
|
@@ -745,12 +746,12 @@ export class UsingRelationshipJoinExpr extends ClassRefExpr {
|
|
|
745
746
|
}
|
|
746
747
|
}
|
|
747
748
|
}
|
|
748
|
-
UsingRelationshipJoinExpr.type = ExprType.UsingRelationshipJoin;
|
|
749
749
|
/**
|
|
750
750
|
* Describe subquery result test e.g. EXISTS(<subquery>)
|
|
751
751
|
* @alpha
|
|
752
752
|
*/
|
|
753
753
|
export class SubqueryTestExpr extends BooleanExpr {
|
|
754
|
+
static { this.type = ExprType.SubqueryTest; }
|
|
754
755
|
constructor(op, query) {
|
|
755
756
|
super(SubqueryTestExpr.type);
|
|
756
757
|
this.op = op;
|
|
@@ -772,12 +773,12 @@ export class SubqueryTestExpr extends BooleanExpr {
|
|
|
772
773
|
writer.appendExp(this.query);
|
|
773
774
|
}
|
|
774
775
|
}
|
|
775
|
-
SubqueryTestExpr.type = ExprType.SubqueryTest;
|
|
776
776
|
/**
|
|
777
777
|
* Describe a subquery when used in FROM clause.
|
|
778
778
|
* @alpha
|
|
779
779
|
*/
|
|
780
780
|
export class SubqueryRefExpr extends ClassRefExpr {
|
|
781
|
+
static { this.type = ExprType.SubqueryRef; }
|
|
781
782
|
constructor(query, polymorphicInfo, alias) {
|
|
782
783
|
super(SubqueryRefExpr.type);
|
|
783
784
|
this.query = query;
|
|
@@ -811,12 +812,12 @@ export class SubqueryRefExpr extends ClassRefExpr {
|
|
|
811
812
|
}
|
|
812
813
|
}
|
|
813
814
|
}
|
|
814
|
-
SubqueryRefExpr.type = ExprType.SubqueryRef;
|
|
815
815
|
/**
|
|
816
816
|
* Describe a optionally compound SELECT statement.
|
|
817
817
|
* @alpha
|
|
818
818
|
*/
|
|
819
819
|
export class SelectStatementExpr extends StatementExpr {
|
|
820
|
+
static { this.type = ExprType.SelectStatement; }
|
|
820
821
|
constructor(singleSelect, nextSelect) {
|
|
821
822
|
super(SelectStatementExpr.type);
|
|
822
823
|
this.singleSelect = singleSelect;
|
|
@@ -859,12 +860,12 @@ export class SelectStatementExpr extends StatementExpr {
|
|
|
859
860
|
}
|
|
860
861
|
}
|
|
861
862
|
}
|
|
862
|
-
SelectStatementExpr.type = ExprType.SelectStatement;
|
|
863
863
|
/**
|
|
864
864
|
* Describe selection in a SELECT query
|
|
865
865
|
* @alpha
|
|
866
866
|
*/
|
|
867
867
|
export class SelectionClauseExpr extends Expr {
|
|
868
|
+
static { this.type = ExprType.SelectionClause; }
|
|
868
869
|
constructor(derivedPropertyList) {
|
|
869
870
|
super(SelectionClauseExpr.type);
|
|
870
871
|
this.derivedPropertyList = derivedPropertyList;
|
|
@@ -887,12 +888,12 @@ export class SelectionClauseExpr extends Expr {
|
|
|
887
888
|
});
|
|
888
889
|
}
|
|
889
890
|
}
|
|
890
|
-
SelectionClauseExpr.type = ExprType.SelectionClause;
|
|
891
891
|
/**
|
|
892
892
|
* Describe a GROUP BY clause in a SELECT statement.
|
|
893
893
|
* @alpha
|
|
894
894
|
*/
|
|
895
895
|
export class GroupByClauseExpr extends Expr {
|
|
896
|
+
static { this.type = ExprType.GroupByClause; }
|
|
896
897
|
constructor(exprList) {
|
|
897
898
|
super(GroupByClauseExpr.type);
|
|
898
899
|
this.exprList = exprList;
|
|
@@ -919,12 +920,12 @@ export class GroupByClauseExpr extends Expr {
|
|
|
919
920
|
});
|
|
920
921
|
}
|
|
921
922
|
}
|
|
922
|
-
GroupByClauseExpr.type = ExprType.GroupByClause;
|
|
923
923
|
/**
|
|
924
924
|
* Describe a HAVING clause in a SELECT statement.
|
|
925
925
|
* @alpha
|
|
926
926
|
*/
|
|
927
927
|
export class HavingClauseExpr extends Expr {
|
|
928
|
+
static { this.type = ExprType.HavingClause; }
|
|
928
929
|
constructor(filterExpr) {
|
|
929
930
|
super(HavingClauseExpr.type);
|
|
930
931
|
this.filterExpr = filterExpr;
|
|
@@ -944,12 +945,12 @@ export class HavingClauseExpr extends Expr {
|
|
|
944
945
|
writer.appendExp(this.filterExpr);
|
|
945
946
|
}
|
|
946
947
|
}
|
|
947
|
-
HavingClauseExpr.type = ExprType.HavingClause;
|
|
948
948
|
/**
|
|
949
949
|
* Describe a FROM clause in a SELECT statement.
|
|
950
950
|
* @alpha
|
|
951
951
|
*/
|
|
952
952
|
export class FromClauseExpr extends Expr {
|
|
953
|
+
static { this.type = ExprType.FromClause; }
|
|
953
954
|
constructor(classRefs) {
|
|
954
955
|
super(FromClauseExpr.type);
|
|
955
956
|
this.classRefs = classRefs;
|
|
@@ -974,12 +975,12 @@ export class FromClauseExpr extends Expr {
|
|
|
974
975
|
});
|
|
975
976
|
}
|
|
976
977
|
}
|
|
977
|
-
FromClauseExpr.type = ExprType.FromClause;
|
|
978
978
|
/**
|
|
979
979
|
* Describe a WHERE clause in a SELECT, UPDATE and DELETE statement.
|
|
980
980
|
* @alpha
|
|
981
981
|
*/
|
|
982
982
|
export class WhereClauseExp extends Expr {
|
|
983
|
+
static { this.type = ExprType.WhereClause; }
|
|
983
984
|
constructor(filterExpr) {
|
|
984
985
|
super(WhereClauseExp.type);
|
|
985
986
|
this.filterExpr = filterExpr;
|
|
@@ -999,12 +1000,12 @@ export class WhereClauseExp extends Expr {
|
|
|
999
1000
|
writer.appendExp(this.filterExpr);
|
|
1000
1001
|
}
|
|
1001
1002
|
}
|
|
1002
|
-
WhereClauseExp.type = ExprType.WhereClause;
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Describe a single sorted term in a ORDER BY clause of a SELECT statement.
|
|
1005
1005
|
* @alpha
|
|
1006
1006
|
*/
|
|
1007
1007
|
export class OrderBySpecExpr extends Expr {
|
|
1008
|
+
static { this.type = ExprType.OrderBySpec; }
|
|
1008
1009
|
constructor(term, sortDirection, nulls) {
|
|
1009
1010
|
super(OrderBySpecExpr.type);
|
|
1010
1011
|
this.term = term;
|
|
@@ -1034,12 +1035,12 @@ export class OrderBySpecExpr extends Expr {
|
|
|
1034
1035
|
}
|
|
1035
1036
|
}
|
|
1036
1037
|
}
|
|
1037
|
-
OrderBySpecExpr.type = ExprType.OrderBySpec;
|
|
1038
1038
|
/**
|
|
1039
1039
|
* Describe a ORDER BY clause in a SELECT statement.
|
|
1040
1040
|
* @alpha
|
|
1041
1041
|
*/
|
|
1042
1042
|
export class OrderByClauseExpr extends Expr {
|
|
1043
|
+
static { this.type = ExprType.OrderByClause; }
|
|
1043
1044
|
constructor(terms) {
|
|
1044
1045
|
super(OrderByClauseExpr.type);
|
|
1045
1046
|
this.terms = terms;
|
|
@@ -1066,12 +1067,12 @@ export class OrderByClauseExpr extends Expr {
|
|
|
1066
1067
|
});
|
|
1067
1068
|
}
|
|
1068
1069
|
}
|
|
1069
|
-
OrderByClauseExpr.type = ExprType.OrderByClause;
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Describe a LIMIT clause in a SELECT statement.
|
|
1072
1072
|
* @alpha
|
|
1073
1073
|
*/
|
|
1074
1074
|
export class LimitClauseExpr extends Expr {
|
|
1075
|
+
static { this.type = ExprType.LimitClause; }
|
|
1075
1076
|
constructor(limit, offset) {
|
|
1076
1077
|
super(LimitClauseExpr.type);
|
|
1077
1078
|
this.limit = limit;
|
|
@@ -1101,12 +1102,12 @@ export class LimitClauseExpr extends Expr {
|
|
|
1101
1102
|
}
|
|
1102
1103
|
}
|
|
1103
1104
|
}
|
|
1104
|
-
LimitClauseExpr.type = ExprType.LimitClause;
|
|
1105
1105
|
/**
|
|
1106
1106
|
* Describe a single select statement.
|
|
1107
1107
|
* @alpha
|
|
1108
1108
|
*/
|
|
1109
1109
|
export class SelectExpr extends Expr {
|
|
1110
|
+
static { this.type = ExprType.Select; }
|
|
1110
1111
|
constructor(selection, rowQuantifier, from, where, groupBy, having, orderBy, limit, options) {
|
|
1111
1112
|
super(SelectExpr.type);
|
|
1112
1113
|
this.selection = selection;
|
|
@@ -1194,12 +1195,12 @@ export class SelectExpr extends Expr {
|
|
|
1194
1195
|
}
|
|
1195
1196
|
}
|
|
1196
1197
|
}
|
|
1197
|
-
SelectExpr.type = ExprType.Select;
|
|
1198
1198
|
/**
|
|
1199
1199
|
* Describe a subquery when used as value. This kind of query expect to return one column and one one value.
|
|
1200
1200
|
* @alpha
|
|
1201
1201
|
*/
|
|
1202
1202
|
export class SubqueryExpr extends ValueExpr {
|
|
1203
|
+
static { this.type = ExprType.Subquery; }
|
|
1203
1204
|
constructor(query) {
|
|
1204
1205
|
super(SubqueryExpr.type);
|
|
1205
1206
|
this.query = query;
|
|
@@ -1223,12 +1224,12 @@ export class SubqueryExpr extends ValueExpr {
|
|
|
1223
1224
|
writer.append(")");
|
|
1224
1225
|
}
|
|
1225
1226
|
}
|
|
1226
|
-
SubqueryExpr.type = ExprType.Subquery;
|
|
1227
1227
|
/**
|
|
1228
1228
|
* Describe a binary boolean expression in ECSQL.
|
|
1229
1229
|
* @alpha
|
|
1230
1230
|
*/
|
|
1231
1231
|
export class BinaryBooleanExpr extends BooleanExpr {
|
|
1232
|
+
static { this.type = ExprType.BinaryBoolean; }
|
|
1232
1233
|
constructor(op, lhsExpr, rhsExpr, not) {
|
|
1233
1234
|
super(BinaryBooleanExpr.type);
|
|
1234
1235
|
this.op = op;
|
|
@@ -1254,12 +1255,12 @@ export class BinaryBooleanExpr extends BooleanExpr {
|
|
|
1254
1255
|
writer.append(")");
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
|
-
BinaryBooleanExpr.type = ExprType.BinaryBoolean;
|
|
1258
1258
|
/**
|
|
1259
1259
|
* Describe a <expr> IS NULL boolean expression
|
|
1260
1260
|
* @alpha
|
|
1261
1261
|
*/
|
|
1262
1262
|
export class IsNullExpr extends BooleanExpr {
|
|
1263
|
+
static { this.type = ExprType.IsNull; }
|
|
1263
1264
|
constructor(operandExpr, not) {
|
|
1264
1265
|
super(IsNullExpr.type);
|
|
1265
1266
|
this.operandExpr = operandExpr;
|
|
@@ -1300,12 +1301,12 @@ export class IsNullExpr extends BooleanExpr {
|
|
|
1300
1301
|
writer.appendKeyword("NULL");
|
|
1301
1302
|
}
|
|
1302
1303
|
}
|
|
1303
|
-
IsNullExpr.type = ExprType.IsNull;
|
|
1304
1304
|
/**
|
|
1305
1305
|
* Describe a <expr> IS (type1[, type2]) in ECSQL.
|
|
1306
1306
|
* @alpha
|
|
1307
1307
|
*/
|
|
1308
1308
|
export class IsOfTypeExpr extends BooleanExpr {
|
|
1309
|
+
static { this.type = ExprType.IsOfType; }
|
|
1309
1310
|
constructor(lhsExpr, typeNames, not) {
|
|
1310
1311
|
super(IsOfTypeExpr.type);
|
|
1311
1312
|
this.lhsExpr = lhsExpr;
|
|
@@ -1350,12 +1351,12 @@ export class IsOfTypeExpr extends BooleanExpr {
|
|
|
1350
1351
|
writer.append(")");
|
|
1351
1352
|
}
|
|
1352
1353
|
}
|
|
1353
|
-
IsOfTypeExpr.type = ExprType.IsOfType;
|
|
1354
1354
|
/**
|
|
1355
1355
|
* Describe a NOT <expr> boolean expression
|
|
1356
1356
|
* @alpha
|
|
1357
1357
|
*/
|
|
1358
1358
|
export class NotExpr extends BooleanExpr {
|
|
1359
|
+
static { this.type = ExprType.Not; }
|
|
1359
1360
|
constructor(operandExpr) {
|
|
1360
1361
|
super(NotExpr.type);
|
|
1361
1362
|
this.operandExpr = operandExpr;
|
|
@@ -1378,12 +1379,12 @@ export class NotExpr extends BooleanExpr {
|
|
|
1378
1379
|
writer.append(")");
|
|
1379
1380
|
}
|
|
1380
1381
|
}
|
|
1381
|
-
NotExpr.type = ExprType.Not;
|
|
1382
1382
|
/**
|
|
1383
1383
|
* Describe a <expr> IN subquery|(val1[,val2...]) boolean expression
|
|
1384
1384
|
* @alpha
|
|
1385
1385
|
*/
|
|
1386
1386
|
export class InExpr extends BooleanExpr {
|
|
1387
|
+
static { this.type = ExprType.In; }
|
|
1387
1388
|
constructor(lhsExpr, rhsExpr, not) {
|
|
1388
1389
|
super(InExpr.type);
|
|
1389
1390
|
this.lhsExpr = lhsExpr;
|
|
@@ -1445,12 +1446,12 @@ export class InExpr extends BooleanExpr {
|
|
|
1445
1446
|
}
|
|
1446
1447
|
}
|
|
1447
1448
|
}
|
|
1448
|
-
InExpr.type = ExprType.In;
|
|
1449
1449
|
/**
|
|
1450
1450
|
* Describe a <expr> LIKE <expr> [ESCAPE <expr>] boolean expression
|
|
1451
1451
|
* @alpha
|
|
1452
1452
|
*/
|
|
1453
1453
|
export class LikeExpr extends BooleanExpr {
|
|
1454
|
+
static { this.type = ExprType.Like; }
|
|
1454
1455
|
constructor(lhsExpr, patternExpr, escapeExpr, not) {
|
|
1455
1456
|
super(LikeExpr.type);
|
|
1456
1457
|
this.lhsExpr = lhsExpr;
|
|
@@ -1498,12 +1499,12 @@ export class LikeExpr extends BooleanExpr {
|
|
|
1498
1499
|
}
|
|
1499
1500
|
}
|
|
1500
1501
|
}
|
|
1501
|
-
LikeExpr.type = ExprType.Like;
|
|
1502
1502
|
/**
|
|
1503
1503
|
* Describe a <expr> BETWEEN <expr> AND <expr> boolean expression
|
|
1504
1504
|
* @alpha
|
|
1505
1505
|
*/
|
|
1506
1506
|
export class BetweenExpr extends BooleanExpr {
|
|
1507
|
+
static { this.type = ExprType.Between; }
|
|
1507
1508
|
constructor(lhsExpr, lowerBoundExpr, upperBoundExpr, not) {
|
|
1508
1509
|
super(BetweenExpr.type);
|
|
1509
1510
|
this.lhsExpr = lhsExpr;
|
|
@@ -1544,12 +1545,12 @@ export class BetweenExpr extends BooleanExpr {
|
|
|
1544
1545
|
writer.appendExp(this.upperBoundExpr);
|
|
1545
1546
|
}
|
|
1546
1547
|
}
|
|
1547
|
-
BetweenExpr.type = ExprType.Between;
|
|
1548
1548
|
/**
|
|
1549
1549
|
* Describe a common table expression base query statement
|
|
1550
1550
|
* @alpha
|
|
1551
1551
|
*/
|
|
1552
1552
|
export class CteExpr extends StatementExpr {
|
|
1553
|
+
static { this.type = ExprType.Cte; }
|
|
1553
1554
|
constructor(cteBlocks, query, recursive) {
|
|
1554
1555
|
super(CteExpr.type);
|
|
1555
1556
|
this.cteBlocks = cteBlocks;
|
|
@@ -1583,12 +1584,12 @@ export class CteExpr extends StatementExpr {
|
|
|
1583
1584
|
writer.appendExp(this.query);
|
|
1584
1585
|
}
|
|
1585
1586
|
}
|
|
1586
|
-
CteExpr.type = ExprType.Cte;
|
|
1587
1587
|
/**
|
|
1588
1588
|
* Describe a single block of CTE that can be reference in FROM clause of a SELECT
|
|
1589
1589
|
* @alpha
|
|
1590
1590
|
*/
|
|
1591
1591
|
export class CteBlockExpr extends Expr {
|
|
1592
|
+
static { this.type = ExprType.CteBlock; }
|
|
1592
1593
|
constructor(name, query, props) {
|
|
1593
1594
|
super(CteBlockExpr.type);
|
|
1594
1595
|
this.name = name;
|
|
@@ -1628,12 +1629,12 @@ export class CteBlockExpr extends Expr {
|
|
|
1628
1629
|
writer.append(")");
|
|
1629
1630
|
}
|
|
1630
1631
|
}
|
|
1631
|
-
CteBlockExpr.type = ExprType.CteBlock;
|
|
1632
1632
|
/**
|
|
1633
1633
|
* Describe a name reference to a CTE block.
|
|
1634
1634
|
* @alpha
|
|
1635
1635
|
*/
|
|
1636
1636
|
export class CteBlockRefExpr extends ClassRefExpr {
|
|
1637
|
+
static { this.type = ExprType.CteBlockRef; }
|
|
1637
1638
|
constructor(name, alias) {
|
|
1638
1639
|
super(CteBlockRefExpr.type);
|
|
1639
1640
|
this.name = name;
|
|
@@ -1655,12 +1656,12 @@ export class CteBlockRefExpr extends ClassRefExpr {
|
|
|
1655
1656
|
}
|
|
1656
1657
|
}
|
|
1657
1658
|
}
|
|
1658
|
-
CteBlockRefExpr.type = ExprType.CteBlockRef;
|
|
1659
1659
|
/**
|
|
1660
1660
|
* Describe a table value function expression in ECSQL that appear in FROM clause of query.
|
|
1661
1661
|
* @alpha
|
|
1662
1662
|
*/
|
|
1663
1663
|
export class TableValuedFuncExpr extends ClassRefExpr {
|
|
1664
|
+
static { this.type = ExprType.TableValuedFunc; }
|
|
1664
1665
|
constructor(schemaName, memberFunc, alias) {
|
|
1665
1666
|
super(TableValuedFuncExpr.type);
|
|
1666
1667
|
this.schemaName = schemaName;
|
|
@@ -1686,12 +1687,12 @@ export class TableValuedFuncExpr extends ClassRefExpr {
|
|
|
1686
1687
|
}
|
|
1687
1688
|
}
|
|
1688
1689
|
}
|
|
1689
|
-
TableValuedFuncExpr.type = ExprType.TableValuedFunc;
|
|
1690
1690
|
/**
|
|
1691
1691
|
* Describe a class name reference in ECSQL that appear in FROM clause of a SELECT.
|
|
1692
1692
|
* @alpha
|
|
1693
1693
|
*/
|
|
1694
1694
|
export class ClassNameExpr extends ClassRefExpr {
|
|
1695
|
+
static { this.type = ExprType.ClassName; }
|
|
1695
1696
|
constructor(schemaNameOrAlias, className, tablespace, alias, polymorphicInfo, memberFunc) {
|
|
1696
1697
|
super(ClassNameExpr.type);
|
|
1697
1698
|
this.schemaNameOrAlias = schemaNameOrAlias;
|
|
@@ -1762,12 +1763,12 @@ export class ClassNameExpr extends ClassRefExpr {
|
|
|
1762
1763
|
return new ClassNameExpr(schemaOrAlias, className, tablespace, alias, polyInfo);
|
|
1763
1764
|
}
|
|
1764
1765
|
}
|
|
1765
|
-
ClassNameExpr.type = ExprType.ClassName;
|
|
1766
1766
|
/**
|
|
1767
1767
|
* Describe a UPDATE statement in ECSQL.
|
|
1768
1768
|
* @alpha
|
|
1769
1769
|
*/
|
|
1770
1770
|
export class UpdateStatementExpr extends StatementExpr {
|
|
1771
|
+
static { this.type = ExprType.UpdateStatement; }
|
|
1771
1772
|
constructor(className, assignement, where, options) {
|
|
1772
1773
|
super(UpdateStatementExpr.type);
|
|
1773
1774
|
this.className = className;
|
|
@@ -1809,12 +1810,12 @@ export class UpdateStatementExpr extends StatementExpr {
|
|
|
1809
1810
|
}
|
|
1810
1811
|
}
|
|
1811
1812
|
}
|
|
1812
|
-
UpdateStatementExpr.type = ExprType.UpdateStatement;
|
|
1813
1813
|
/**
|
|
1814
1814
|
* Describe ECSQL option clause.
|
|
1815
1815
|
* @alpha
|
|
1816
1816
|
*/
|
|
1817
1817
|
export class ECSqlOptionsClauseExpr extends Expr {
|
|
1818
|
+
static { this.type = ExprType.ECSqlOptionsClause; }
|
|
1818
1819
|
constructor(options) {
|
|
1819
1820
|
super(ECSqlOptionsClauseExpr.type);
|
|
1820
1821
|
this.options = options;
|
|
@@ -1843,12 +1844,12 @@ export class ECSqlOptionsClauseExpr extends Expr {
|
|
|
1843
1844
|
});
|
|
1844
1845
|
}
|
|
1845
1846
|
}
|
|
1846
|
-
ECSqlOptionsClauseExpr.type = ExprType.ECSqlOptionsClause;
|
|
1847
1847
|
/**
|
|
1848
1848
|
* A single property value assignment for update clause
|
|
1849
1849
|
* @alpha
|
|
1850
1850
|
*/
|
|
1851
1851
|
export class AssignmentExpr extends Expr {
|
|
1852
|
+
static { this.type = ExprType.Assignment; }
|
|
1852
1853
|
constructor(propertyName, valueExpr) {
|
|
1853
1854
|
super(SetClauseExpr.type);
|
|
1854
1855
|
this.propertyName = propertyName;
|
|
@@ -1869,12 +1870,12 @@ export class AssignmentExpr extends Expr {
|
|
|
1869
1870
|
writer.appendExp(this.valueExpr);
|
|
1870
1871
|
}
|
|
1871
1872
|
}
|
|
1872
|
-
AssignmentExpr.type = ExprType.Assignment;
|
|
1873
1873
|
/**
|
|
1874
1874
|
* Describe a set clause in a UPDATE statement
|
|
1875
1875
|
* @alpha
|
|
1876
1876
|
*/
|
|
1877
1877
|
export class SetClauseExpr extends Expr {
|
|
1878
|
+
static { this.type = ExprType.SetClause; }
|
|
1878
1879
|
constructor(assignments) {
|
|
1879
1880
|
super(SetClauseExpr.type);
|
|
1880
1881
|
this.assignments = assignments;
|
|
@@ -1904,12 +1905,12 @@ export class SetClauseExpr extends Expr {
|
|
|
1904
1905
|
});
|
|
1905
1906
|
}
|
|
1906
1907
|
}
|
|
1907
|
-
SetClauseExpr.type = ExprType.SetClause;
|
|
1908
1908
|
/**
|
|
1909
1909
|
* Describe a strong typed IIF function in ECSQL
|
|
1910
1910
|
* @alpha
|
|
1911
1911
|
*/
|
|
1912
1912
|
export class IIFExpr extends ValueExpr {
|
|
1913
|
+
static { this.type = ExprType.IIF; }
|
|
1913
1914
|
constructor(whenExpr, thenExpr, elseExpr) {
|
|
1914
1915
|
super(IIFExpr.type);
|
|
1915
1916
|
this.whenExpr = whenExpr;
|
|
@@ -1936,12 +1937,12 @@ export class IIFExpr extends ValueExpr {
|
|
|
1936
1937
|
writer.append(")");
|
|
1937
1938
|
}
|
|
1938
1939
|
}
|
|
1939
|
-
IIFExpr.type = ExprType.IIF;
|
|
1940
1940
|
/**
|
|
1941
1941
|
* Describe a CASE-WHEN-THEN expression in ECSQL
|
|
1942
1942
|
* @alpha
|
|
1943
1943
|
*/
|
|
1944
1944
|
export class SearchCaseExpr extends ValueExpr {
|
|
1945
|
+
static { this.type = ExprType.SearchCase; }
|
|
1945
1946
|
constructor(whenThenList, elseExpr) {
|
|
1946
1947
|
super(SearchCaseExpr.type);
|
|
1947
1948
|
this.whenThenList = whenThenList;
|
|
@@ -1992,12 +1993,12 @@ export class SearchCaseExpr extends ValueExpr {
|
|
|
1992
1993
|
writer.appendKeyword("END");
|
|
1993
1994
|
}
|
|
1994
1995
|
}
|
|
1995
|
-
SearchCaseExpr.type = ExprType.SearchCase;
|
|
1996
1996
|
/**
|
|
1997
1997
|
* Describe a binary value expression
|
|
1998
1998
|
* @alpha
|
|
1999
1999
|
*/
|
|
2000
2000
|
export class BinaryValueExpr extends ValueExpr {
|
|
2001
|
+
static { this.type = ExprType.BinaryValue; }
|
|
2001
2002
|
constructor(op, lhsExpr, rhsExpr) {
|
|
2002
2003
|
super(BinaryValueExpr.type);
|
|
2003
2004
|
this.op = op;
|
|
@@ -2021,12 +2022,12 @@ export class BinaryValueExpr extends ValueExpr {
|
|
|
2021
2022
|
writer.append(")");
|
|
2022
2023
|
}
|
|
2023
2024
|
}
|
|
2024
|
-
BinaryValueExpr.type = ExprType.BinaryValue;
|
|
2025
2025
|
/**
|
|
2026
2026
|
* Cast a expression into a target time e.g. CAST(<expr> AS STRING)
|
|
2027
2027
|
* @alpha
|
|
2028
2028
|
*/
|
|
2029
2029
|
export class CastExpr extends ValueExpr {
|
|
2030
|
+
static { this.type = ExprType.Cast; }
|
|
2030
2031
|
constructor(valueExpr, targetType) {
|
|
2031
2032
|
super(CastExpr.type);
|
|
2032
2033
|
this.valueExpr = valueExpr;
|
|
@@ -2052,12 +2053,12 @@ export class CastExpr extends ValueExpr {
|
|
|
2052
2053
|
writer.append(")");
|
|
2053
2054
|
}
|
|
2054
2055
|
}
|
|
2055
|
-
CastExpr.type = ExprType.Cast;
|
|
2056
2056
|
/**
|
|
2057
2057
|
* Represent a member function called w.r.t a ClassNameExpr
|
|
2058
2058
|
* @alpha
|
|
2059
2059
|
*/
|
|
2060
2060
|
export class MemberFuncCallExpr extends Expr {
|
|
2061
|
+
static { this.type = ExprType.MemberFuncCall; }
|
|
2061
2062
|
constructor(functionName, args) {
|
|
2062
2063
|
super(MemberFuncCallExpr.type);
|
|
2063
2064
|
this.functionName = functionName;
|
|
@@ -2085,12 +2086,12 @@ export class MemberFuncCallExpr extends Expr {
|
|
|
2085
2086
|
writer.append(")");
|
|
2086
2087
|
}
|
|
2087
2088
|
}
|
|
2088
|
-
MemberFuncCallExpr.type = ExprType.MemberFuncCall;
|
|
2089
2089
|
/**
|
|
2090
2090
|
* Represent a function call in ecsql
|
|
2091
2091
|
* @alpha
|
|
2092
2092
|
*/
|
|
2093
2093
|
export class FuncCallExpr extends ValueExpr {
|
|
2094
|
+
static { this.type = ExprType.FuncCall; }
|
|
2094
2095
|
constructor(functionName, args, allOrDistinct) {
|
|
2095
2096
|
super(FuncCallExpr.type);
|
|
2096
2097
|
this.functionName = functionName;
|
|
@@ -2226,12 +2227,12 @@ export class FuncCallExpr extends ValueExpr {
|
|
|
2226
2227
|
return new FuncCallExpr("EC_INSTANCEOF", [arg0, arg1]);
|
|
2227
2228
|
}
|
|
2228
2229
|
}
|
|
2229
|
-
FuncCallExpr.type = ExprType.FuncCall;
|
|
2230
2230
|
/**
|
|
2231
2231
|
* Represent positional or named parameter
|
|
2232
2232
|
* @alpha
|
|
2233
2233
|
*/
|
|
2234
2234
|
export class ParameterExpr extends ValueExpr {
|
|
2235
|
+
static { this.type = ExprType.Parameter; }
|
|
2235
2236
|
constructor(name) {
|
|
2236
2237
|
super(ParameterExpr.type);
|
|
2237
2238
|
this.name = name;
|
|
@@ -2252,12 +2253,12 @@ export class ParameterExpr extends ValueExpr {
|
|
|
2252
2253
|
writer.append(`?`);
|
|
2253
2254
|
}
|
|
2254
2255
|
}
|
|
2255
|
-
ParameterExpr.type = ExprType.Parameter;
|
|
2256
2256
|
/**
|
|
2257
2257
|
* Unary value with operator e.g. [+|-|~]<number>
|
|
2258
2258
|
* @alpha
|
|
2259
2259
|
*/
|
|
2260
2260
|
export class UnaryValueExpr extends ValueExpr {
|
|
2261
|
+
static { this.type = ExprType.Unary; }
|
|
2261
2262
|
constructor(op, valueExpr) {
|
|
2262
2263
|
super(UnaryValueExpr.type);
|
|
2263
2264
|
this.op = op;
|
|
@@ -2280,12 +2281,12 @@ export class UnaryValueExpr extends ValueExpr {
|
|
|
2280
2281
|
writer.appendExp(this.valueExpr);
|
|
2281
2282
|
}
|
|
2282
2283
|
}
|
|
2283
|
-
UnaryValueExpr.type = ExprType.Unary;
|
|
2284
2284
|
/**
|
|
2285
2285
|
* Represent constant literal like string, data, time, timestamp, number or null
|
|
2286
2286
|
* @alpha
|
|
2287
2287
|
*/
|
|
2288
2288
|
export class LiteralExpr extends ValueExpr {
|
|
2289
|
+
static { this.type = ExprType.Literal; }
|
|
2289
2290
|
constructor(valueType, rawValue) {
|
|
2290
2291
|
super(LiteralExpr.type);
|
|
2291
2292
|
this.valueType = valueType;
|
|
@@ -2322,12 +2323,12 @@ export class LiteralExpr extends ValueExpr {
|
|
|
2322
2323
|
static makeTimestamp(val) { return new LiteralExpr(LiteralValueType.String, val.toTimeString()); }
|
|
2323
2324
|
static makeNull() { return new LiteralExpr(LiteralValueType.Null, ""); }
|
|
2324
2325
|
}
|
|
2325
|
-
LiteralExpr.type = ExprType.Literal;
|
|
2326
2326
|
/**
|
|
2327
2327
|
* Represent property name identifier
|
|
2328
2328
|
* @alpha
|
|
2329
2329
|
*/
|
|
2330
2330
|
export class PropertyNameExpr extends ValueExpr {
|
|
2331
|
+
static { this.type = ExprType.PropertyName; }
|
|
2331
2332
|
constructor(propertyPath) {
|
|
2332
2333
|
super(PropertyNameExpr.type);
|
|
2333
2334
|
this.propertyPath = propertyPath;
|
|
@@ -2351,12 +2352,13 @@ export class PropertyNameExpr extends ValueExpr {
|
|
|
2351
2352
|
writer.append(str[str.length - 1].split(".").map((v) => v.startsWith("[") || v === "$" ? v : `[${v}]`).join("."));
|
|
2352
2353
|
}
|
|
2353
2354
|
}
|
|
2354
|
-
PropertyNameExpr.type = ExprType.PropertyName;
|
|
2355
2355
|
/**
|
|
2356
2356
|
* Represent navigation value creation function
|
|
2357
2357
|
* @alpha
|
|
2358
2358
|
*/
|
|
2359
2359
|
export class NavValueCreationFuncExpr extends ValueExpr {
|
|
2360
|
+
static { this.type = ExprType.NavValueCreationFunc; }
|
|
2361
|
+
static { this.navValueCreationFuncExprName = "NAVIGATION_VALUE"; }
|
|
2360
2362
|
constructor(columnRefExp, idArgExp, classNameExp, relECClassIdExp) {
|
|
2361
2363
|
super(NavValueCreationFuncExpr.type);
|
|
2362
2364
|
this.columnRefExp = columnRefExp;
|
|
@@ -2391,6 +2393,4 @@ export class NavValueCreationFuncExpr extends ValueExpr {
|
|
|
2391
2393
|
return new NavValueCreationFuncExpr(DerivedPropertyExpr.deserialize(node.ColumnRefExp), ValueExpr.deserialize(node.IdArgExp), ClassNameExpr.deserialize(node.ClassNameExp), node.RelECClassIdExp ? ValueExpr.deserialize(node.RelECClassIdExp) : undefined);
|
|
2392
2394
|
}
|
|
2393
2395
|
}
|
|
2394
|
-
NavValueCreationFuncExpr.type = ExprType.NavValueCreationFunc;
|
|
2395
|
-
NavValueCreationFuncExpr.navValueCreationFuncExprName = "NAVIGATION_VALUE";
|
|
2396
2396
|
//# sourceMappingURL=ECSqlAst.js.map
|