@itwin/ecsql-common 5.0.0-dev.9 → 5.0.0-dev.92

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.
@@ -127,6 +127,7 @@ export var ExprType;
127
127
  * @alpha
128
128
  */
129
129
  export class ExprFactory {
130
+ provider;
130
131
  constructor(provider) {
131
132
  this.provider = provider;
132
133
  }
@@ -139,6 +140,7 @@ export class ExprFactory {
139
140
  * @alpha
140
141
  */
141
142
  export class Expr {
143
+ expType;
142
144
  constructor(expType) {
143
145
  this.expType = expType;
144
146
  }
@@ -247,6 +249,7 @@ export class ComputedExpr extends Expr {
247
249
  * @alpha
248
250
  */
249
251
  export class BooleanExpr extends ComputedExpr {
252
+ static deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.BooleanFactor, NativeExpIds.SubqueryTest, NativeExpIds.AllOrAny, NativeExpIds.BooleanFactor];
250
253
  static deserialize(node) {
251
254
  if (node.id === NativeExpIds.BinaryBoolean) {
252
255
  const op = node.op;
@@ -282,7 +285,6 @@ export class BooleanExpr extends ComputedExpr {
282
285
  throw new Error(`Unknown type of native value exp ${node.id}`);
283
286
  }
284
287
  }
285
- BooleanExpr.deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.BooleanFactor, NativeExpIds.SubqueryTest, NativeExpIds.AllOrAny, NativeExpIds.BooleanFactor];
286
288
  /**
287
289
  * Base class for all value expressions. Following is list of subclasses.
288
290
  * @see [[SubqueryExpr]]
@@ -299,6 +301,19 @@ BooleanExpr.deserializableIds = [NativeExpIds.BinaryBoolean, NativeExpIds.Boolea
299
301
  * @alpha
300
302
  */
301
303
  export class ValueExpr extends ComputedExpr {
304
+ static deserializableIds = [
305
+ NativeExpIds.LiteralValue,
306
+ NativeExpIds.Parameter,
307
+ NativeExpIds.FunctionCall,
308
+ NativeExpIds.Cast,
309
+ NativeExpIds.BinaryValue,
310
+ NativeExpIds.SearchCaseValue,
311
+ NativeExpIds.IIF,
312
+ NativeExpIds.UnaryValue,
313
+ NativeExpIds.PropertyName,
314
+ NativeExpIds.Subquery,
315
+ NativeExpIds.NavValueCreationFunc,
316
+ ];
302
317
  static deserialize(node) {
303
318
  if (node.id === NativeExpIds.UnaryValue) {
304
319
  return UnaryValueExpr.deserialize(node);
@@ -335,19 +350,6 @@ export class ValueExpr extends ComputedExpr {
335
350
  throw new Error(`Unknown type of native value exp ${node.id}`);
336
351
  }
337
352
  }
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
353
  /**
352
354
  * Base class for expressions that can be used in FROM clause of a SELECT. Following list of this subclasses.
353
355
  * @see [[ClassRefExpr]]
@@ -360,6 +362,13 @@ ValueExpr.deserializableIds = [
360
362
  * @alpha
361
363
  */
362
364
  export class ClassRefExpr extends Expr {
365
+ static deserializableIds = [
366
+ NativeExpIds.ClassName,
367
+ NativeExpIds.SubqueryRef,
368
+ NativeExpIds.UsingRelationshipJoinExp,
369
+ NativeExpIds.QualifiedJoin,
370
+ NativeExpIds.CommonTableBlockName,
371
+ ];
363
372
  static deserialize(node) {
364
373
  if (node.id === NativeExpIds.ClassName) {
365
374
  return ClassNameExpr.deserialize(node);
@@ -382,18 +391,15 @@ export class ClassRefExpr extends Expr {
382
391
  throw new Error(`Unknown type of native value exp ${node.id}`);
383
392
  }
384
393
  }
385
- ClassRefExpr.deserializableIds = [
386
- NativeExpIds.ClassName,
387
- NativeExpIds.SubqueryRef,
388
- NativeExpIds.UsingRelationshipJoinExp,
389
- NativeExpIds.QualifiedJoin,
390
- NativeExpIds.CommonTableBlockName,
391
- ];
392
394
  /**
393
395
  * Write expression tree to string
394
396
  * @alpha
395
397
  */
396
398
  export class ECSqlWriter {
399
+ options;
400
+ _tokens = [];
401
+ _currentIndent = 0;
402
+ _isNewLine = false;
397
403
  constructor(options = {
398
404
  multiline: false,
399
405
  spaceAfterComma: true,
@@ -403,9 +409,6 @@ export class ECSqlWriter {
403
409
  indent: { size: 3, char: " " },
404
410
  }) {
405
411
  this.options = options;
406
- this._tokens = [];
407
- this._currentIndent = 0;
408
- this._isNewLine = false;
409
412
  }
410
413
  indent() {
411
414
  this._currentIndent++;
@@ -492,6 +495,9 @@ export class ECSqlWriter {
492
495
  * @alpha
493
496
  */
494
497
  export class DerivedPropertyExpr extends Expr {
498
+ computedExpr;
499
+ alias;
500
+ static type = ExprType.DerivedProperty;
495
501
  constructor(computedExpr, alias) {
496
502
  super(DerivedPropertyExpr.type);
497
503
  this.computedExpr = computedExpr;
@@ -514,12 +520,15 @@ export class DerivedPropertyExpr extends Expr {
514
520
  }
515
521
  }
516
522
  }
517
- DerivedPropertyExpr.type = ExprType.DerivedProperty;
518
523
  /**
519
524
  * Describes a ECSQL delete statement.
520
525
  * @alpha
521
526
  */
522
527
  export class DeleteStatementExpr extends StatementExpr {
528
+ className;
529
+ where;
530
+ options;
531
+ static type = ExprType.DeleteStatement;
523
532
  constructor(className, where, options) {
524
533
  super(DeleteStatementExpr.type);
525
534
  this.className = className;
@@ -559,12 +568,15 @@ export class DeleteStatementExpr extends StatementExpr {
559
568
  }
560
569
  }
561
570
  }
562
- DeleteStatementExpr.type = ExprType.DeleteStatement;
563
571
  /**
564
572
  * Describe a ECSQL Insert statement.
565
573
  * @alpha
566
574
  */
567
575
  export class InsertStatementExpr extends StatementExpr {
576
+ className;
577
+ values;
578
+ propertyNames;
579
+ static type = ExprType.InsertStatement;
568
580
  constructor(className, values, propertyNames) {
569
581
  super(InsertStatementExpr.type);
570
582
  this.className = className;
@@ -622,12 +634,16 @@ export class InsertStatementExpr extends StatementExpr {
622
634
  writer.append(")");
623
635
  }
624
636
  }
625
- InsertStatementExpr.type = ExprType.InsertStatement;
626
637
  /**
627
638
  * Describes a JOIN clause e.g. <classNameExpr> JOIN <classNameExpr> ON <joinspec>
628
639
  * @alpha
629
640
  */
630
641
  export class QualifiedJoinExpr extends ClassRefExpr {
642
+ joinType;
643
+ from;
644
+ to;
645
+ spec;
646
+ static type = ExprType.QualifiedJoin;
631
647
  constructor(joinType, from, to, spec) {
632
648
  super(QualifiedJoinExpr.type);
633
649
  this.joinType = joinType;
@@ -703,12 +719,16 @@ export class QualifiedJoinExpr extends ClassRefExpr {
703
719
  }
704
720
  }
705
721
  }
706
- QualifiedJoinExpr.type = ExprType.QualifiedJoin;
707
722
  /**
708
723
  * Describe a JOIN USING clause.
709
724
  * @alpha
710
725
  */
711
726
  export class UsingRelationshipJoinExpr extends ClassRefExpr {
727
+ fromClassName;
728
+ toClassName;
729
+ toRelClassName;
730
+ direction;
731
+ static type = ExprType.UsingRelationshipJoin;
712
732
  constructor(fromClassName, toClassName, toRelClassName, direction) {
713
733
  super(UsingRelationshipJoinExpr.type);
714
734
  this.fromClassName = fromClassName;
@@ -745,12 +765,14 @@ export class UsingRelationshipJoinExpr extends ClassRefExpr {
745
765
  }
746
766
  }
747
767
  }
748
- UsingRelationshipJoinExpr.type = ExprType.UsingRelationshipJoin;
749
768
  /**
750
769
  * Describe subquery result test e.g. EXISTS(<subquery>)
751
770
  * @alpha
752
771
  */
753
772
  export class SubqueryTestExpr extends BooleanExpr {
773
+ op;
774
+ query;
775
+ static type = ExprType.SubqueryTest;
754
776
  constructor(op, query) {
755
777
  super(SubqueryTestExpr.type);
756
778
  this.op = op;
@@ -772,12 +794,15 @@ export class SubqueryTestExpr extends BooleanExpr {
772
794
  writer.appendExp(this.query);
773
795
  }
774
796
  }
775
- SubqueryTestExpr.type = ExprType.SubqueryTest;
776
797
  /**
777
798
  * Describe a subquery when used in FROM clause.
778
799
  * @alpha
779
800
  */
780
801
  export class SubqueryRefExpr extends ClassRefExpr {
802
+ query;
803
+ polymorphicInfo;
804
+ alias;
805
+ static type = ExprType.SubqueryRef;
781
806
  constructor(query, polymorphicInfo, alias) {
782
807
  super(SubqueryRefExpr.type);
783
808
  this.query = query;
@@ -811,12 +836,14 @@ export class SubqueryRefExpr extends ClassRefExpr {
811
836
  }
812
837
  }
813
838
  }
814
- SubqueryRefExpr.type = ExprType.SubqueryRef;
815
839
  /**
816
840
  * Describe a optionally compound SELECT statement.
817
841
  * @alpha
818
842
  */
819
843
  export class SelectStatementExpr extends StatementExpr {
844
+ singleSelect;
845
+ nextSelect;
846
+ static type = ExprType.SelectStatement;
820
847
  constructor(singleSelect, nextSelect) {
821
848
  super(SelectStatementExpr.type);
822
849
  this.singleSelect = singleSelect;
@@ -859,12 +886,13 @@ export class SelectStatementExpr extends StatementExpr {
859
886
  }
860
887
  }
861
888
  }
862
- SelectStatementExpr.type = ExprType.SelectStatement;
863
889
  /**
864
890
  * Describe selection in a SELECT query
865
891
  * @alpha
866
892
  */
867
893
  export class SelectionClauseExpr extends Expr {
894
+ derivedPropertyList;
895
+ static type = ExprType.SelectionClause;
868
896
  constructor(derivedPropertyList) {
869
897
  super(SelectionClauseExpr.type);
870
898
  this.derivedPropertyList = derivedPropertyList;
@@ -887,12 +915,13 @@ export class SelectionClauseExpr extends Expr {
887
915
  });
888
916
  }
889
917
  }
890
- SelectionClauseExpr.type = ExprType.SelectionClause;
891
918
  /**
892
919
  * Describe a GROUP BY clause in a SELECT statement.
893
920
  * @alpha
894
921
  */
895
922
  export class GroupByClauseExpr extends Expr {
923
+ exprList;
924
+ static type = ExprType.GroupByClause;
896
925
  constructor(exprList) {
897
926
  super(GroupByClauseExpr.type);
898
927
  this.exprList = exprList;
@@ -919,12 +948,13 @@ export class GroupByClauseExpr extends Expr {
919
948
  });
920
949
  }
921
950
  }
922
- GroupByClauseExpr.type = ExprType.GroupByClause;
923
951
  /**
924
952
  * Describe a HAVING clause in a SELECT statement.
925
953
  * @alpha
926
954
  */
927
955
  export class HavingClauseExpr extends Expr {
956
+ filterExpr;
957
+ static type = ExprType.HavingClause;
928
958
  constructor(filterExpr) {
929
959
  super(HavingClauseExpr.type);
930
960
  this.filterExpr = filterExpr;
@@ -944,12 +974,13 @@ export class HavingClauseExpr extends Expr {
944
974
  writer.appendExp(this.filterExpr);
945
975
  }
946
976
  }
947
- HavingClauseExpr.type = ExprType.HavingClause;
948
977
  /**
949
978
  * Describe a FROM clause in a SELECT statement.
950
979
  * @alpha
951
980
  */
952
981
  export class FromClauseExpr extends Expr {
982
+ classRefs;
983
+ static type = ExprType.FromClause;
953
984
  constructor(classRefs) {
954
985
  super(FromClauseExpr.type);
955
986
  this.classRefs = classRefs;
@@ -974,12 +1005,13 @@ export class FromClauseExpr extends Expr {
974
1005
  });
975
1006
  }
976
1007
  }
977
- FromClauseExpr.type = ExprType.FromClause;
978
1008
  /**
979
1009
  * Describe a WHERE clause in a SELECT, UPDATE and DELETE statement.
980
1010
  * @alpha
981
1011
  */
982
1012
  export class WhereClauseExp extends Expr {
1013
+ filterExpr;
1014
+ static type = ExprType.WhereClause;
983
1015
  constructor(filterExpr) {
984
1016
  super(WhereClauseExp.type);
985
1017
  this.filterExpr = filterExpr;
@@ -999,12 +1031,15 @@ export class WhereClauseExp extends Expr {
999
1031
  writer.appendExp(this.filterExpr);
1000
1032
  }
1001
1033
  }
1002
- WhereClauseExp.type = ExprType.WhereClause;
1003
1034
  /**
1004
1035
  * Describe a single sorted term in a ORDER BY clause of a SELECT statement.
1005
1036
  * @alpha
1006
1037
  */
1007
1038
  export class OrderBySpecExpr extends Expr {
1039
+ term;
1040
+ sortDirection;
1041
+ nulls;
1042
+ static type = ExprType.OrderBySpec;
1008
1043
  constructor(term, sortDirection, nulls) {
1009
1044
  super(OrderBySpecExpr.type);
1010
1045
  this.term = term;
@@ -1034,12 +1069,13 @@ export class OrderBySpecExpr extends Expr {
1034
1069
  }
1035
1070
  }
1036
1071
  }
1037
- OrderBySpecExpr.type = ExprType.OrderBySpec;
1038
1072
  /**
1039
1073
  * Describe a ORDER BY clause in a SELECT statement.
1040
1074
  * @alpha
1041
1075
  */
1042
1076
  export class OrderByClauseExpr extends Expr {
1077
+ terms;
1078
+ static type = ExprType.OrderByClause;
1043
1079
  constructor(terms) {
1044
1080
  super(OrderByClauseExpr.type);
1045
1081
  this.terms = terms;
@@ -1066,12 +1102,14 @@ export class OrderByClauseExpr extends Expr {
1066
1102
  });
1067
1103
  }
1068
1104
  }
1069
- OrderByClauseExpr.type = ExprType.OrderByClause;
1070
1105
  /**
1071
1106
  * Describe a LIMIT clause in a SELECT statement.
1072
1107
  * @alpha
1073
1108
  */
1074
1109
  export class LimitClauseExpr extends Expr {
1110
+ limit;
1111
+ offset;
1112
+ static type = ExprType.LimitClause;
1075
1113
  constructor(limit, offset) {
1076
1114
  super(LimitClauseExpr.type);
1077
1115
  this.limit = limit;
@@ -1101,12 +1139,21 @@ export class LimitClauseExpr extends Expr {
1101
1139
  }
1102
1140
  }
1103
1141
  }
1104
- LimitClauseExpr.type = ExprType.LimitClause;
1105
1142
  /**
1106
1143
  * Describe a single select statement.
1107
1144
  * @alpha
1108
1145
  */
1109
1146
  export class SelectExpr extends Expr {
1147
+ selection;
1148
+ rowQuantifier;
1149
+ from;
1150
+ where;
1151
+ groupBy;
1152
+ having;
1153
+ orderBy;
1154
+ limit;
1155
+ options;
1156
+ static type = ExprType.Select;
1110
1157
  constructor(selection, rowQuantifier, from, where, groupBy, having, orderBy, limit, options) {
1111
1158
  super(SelectExpr.type);
1112
1159
  this.selection = selection;
@@ -1194,12 +1241,13 @@ export class SelectExpr extends Expr {
1194
1241
  }
1195
1242
  }
1196
1243
  }
1197
- SelectExpr.type = ExprType.Select;
1198
1244
  /**
1199
1245
  * Describe a subquery when used as value. This kind of query expect to return one column and one one value.
1200
1246
  * @alpha
1201
1247
  */
1202
1248
  export class SubqueryExpr extends ValueExpr {
1249
+ query;
1250
+ static type = ExprType.Subquery;
1203
1251
  constructor(query) {
1204
1252
  super(SubqueryExpr.type);
1205
1253
  this.query = query;
@@ -1223,12 +1271,16 @@ export class SubqueryExpr extends ValueExpr {
1223
1271
  writer.append(")");
1224
1272
  }
1225
1273
  }
1226
- SubqueryExpr.type = ExprType.Subquery;
1227
1274
  /**
1228
1275
  * Describe a binary boolean expression in ECSQL.
1229
1276
  * @alpha
1230
1277
  */
1231
1278
  export class BinaryBooleanExpr extends BooleanExpr {
1279
+ op;
1280
+ lhsExpr;
1281
+ rhsExpr;
1282
+ not;
1283
+ static type = ExprType.BinaryBoolean;
1232
1284
  constructor(op, lhsExpr, rhsExpr, not) {
1233
1285
  super(BinaryBooleanExpr.type);
1234
1286
  this.op = op;
@@ -1254,12 +1306,14 @@ export class BinaryBooleanExpr extends BooleanExpr {
1254
1306
  writer.append(")");
1255
1307
  }
1256
1308
  }
1257
- BinaryBooleanExpr.type = ExprType.BinaryBoolean;
1258
1309
  /**
1259
1310
  * Describe a <expr> IS NULL boolean expression
1260
1311
  * @alpha
1261
1312
  */
1262
1313
  export class IsNullExpr extends BooleanExpr {
1314
+ operandExpr;
1315
+ not;
1316
+ static type = ExprType.IsNull;
1263
1317
  constructor(operandExpr, not) {
1264
1318
  super(IsNullExpr.type);
1265
1319
  this.operandExpr = operandExpr;
@@ -1300,12 +1354,15 @@ export class IsNullExpr extends BooleanExpr {
1300
1354
  writer.appendKeyword("NULL");
1301
1355
  }
1302
1356
  }
1303
- IsNullExpr.type = ExprType.IsNull;
1304
1357
  /**
1305
1358
  * Describe a <expr> IS (type1[, type2]) in ECSQL.
1306
1359
  * @alpha
1307
1360
  */
1308
1361
  export class IsOfTypeExpr extends BooleanExpr {
1362
+ lhsExpr;
1363
+ typeNames;
1364
+ not;
1365
+ static type = ExprType.IsOfType;
1309
1366
  constructor(lhsExpr, typeNames, not) {
1310
1367
  super(IsOfTypeExpr.type);
1311
1368
  this.lhsExpr = lhsExpr;
@@ -1350,12 +1407,13 @@ export class IsOfTypeExpr extends BooleanExpr {
1350
1407
  writer.append(")");
1351
1408
  }
1352
1409
  }
1353
- IsOfTypeExpr.type = ExprType.IsOfType;
1354
1410
  /**
1355
1411
  * Describe a NOT <expr> boolean expression
1356
1412
  * @alpha
1357
1413
  */
1358
1414
  export class NotExpr extends BooleanExpr {
1415
+ operandExpr;
1416
+ static type = ExprType.Not;
1359
1417
  constructor(operandExpr) {
1360
1418
  super(NotExpr.type);
1361
1419
  this.operandExpr = operandExpr;
@@ -1378,12 +1436,15 @@ export class NotExpr extends BooleanExpr {
1378
1436
  writer.append(")");
1379
1437
  }
1380
1438
  }
1381
- NotExpr.type = ExprType.Not;
1382
1439
  /**
1383
1440
  * Describe a <expr> IN subquery|(val1[,val2...]) boolean expression
1384
1441
  * @alpha
1385
1442
  */
1386
1443
  export class InExpr extends BooleanExpr {
1444
+ lhsExpr;
1445
+ rhsExpr;
1446
+ not;
1447
+ static type = ExprType.In;
1387
1448
  constructor(lhsExpr, rhsExpr, not) {
1388
1449
  super(InExpr.type);
1389
1450
  this.lhsExpr = lhsExpr;
@@ -1445,12 +1506,16 @@ export class InExpr extends BooleanExpr {
1445
1506
  }
1446
1507
  }
1447
1508
  }
1448
- InExpr.type = ExprType.In;
1449
1509
  /**
1450
1510
  * Describe a <expr> LIKE <expr> [ESCAPE <expr>] boolean expression
1451
1511
  * @alpha
1452
1512
  */
1453
1513
  export class LikeExpr extends BooleanExpr {
1514
+ lhsExpr;
1515
+ patternExpr;
1516
+ escapeExpr;
1517
+ not;
1518
+ static type = ExprType.Like;
1454
1519
  constructor(lhsExpr, patternExpr, escapeExpr, not) {
1455
1520
  super(LikeExpr.type);
1456
1521
  this.lhsExpr = lhsExpr;
@@ -1498,12 +1563,16 @@ export class LikeExpr extends BooleanExpr {
1498
1563
  }
1499
1564
  }
1500
1565
  }
1501
- LikeExpr.type = ExprType.Like;
1502
1566
  /**
1503
1567
  * Describe a <expr> BETWEEN <expr> AND <expr> boolean expression
1504
1568
  * @alpha
1505
1569
  */
1506
1570
  export class BetweenExpr extends BooleanExpr {
1571
+ lhsExpr;
1572
+ lowerBoundExpr;
1573
+ upperBoundExpr;
1574
+ not;
1575
+ static type = ExprType.Between;
1507
1576
  constructor(lhsExpr, lowerBoundExpr, upperBoundExpr, not) {
1508
1577
  super(BetweenExpr.type);
1509
1578
  this.lhsExpr = lhsExpr;
@@ -1544,12 +1613,15 @@ export class BetweenExpr extends BooleanExpr {
1544
1613
  writer.appendExp(this.upperBoundExpr);
1545
1614
  }
1546
1615
  }
1547
- BetweenExpr.type = ExprType.Between;
1548
1616
  /**
1549
1617
  * Describe a common table expression base query statement
1550
1618
  * @alpha
1551
1619
  */
1552
1620
  export class CteExpr extends StatementExpr {
1621
+ cteBlocks;
1622
+ query;
1623
+ recursive;
1624
+ static type = ExprType.Cte;
1553
1625
  constructor(cteBlocks, query, recursive) {
1554
1626
  super(CteExpr.type);
1555
1627
  this.cteBlocks = cteBlocks;
@@ -1583,12 +1655,15 @@ export class CteExpr extends StatementExpr {
1583
1655
  writer.appendExp(this.query);
1584
1656
  }
1585
1657
  }
1586
- CteExpr.type = ExprType.Cte;
1587
1658
  /**
1588
1659
  * Describe a single block of CTE that can be reference in FROM clause of a SELECT
1589
1660
  * @alpha
1590
1661
  */
1591
1662
  export class CteBlockExpr extends Expr {
1663
+ name;
1664
+ query;
1665
+ props;
1666
+ static type = ExprType.CteBlock;
1592
1667
  constructor(name, query, props) {
1593
1668
  super(CteBlockExpr.type);
1594
1669
  this.name = name;
@@ -1628,12 +1703,14 @@ export class CteBlockExpr extends Expr {
1628
1703
  writer.append(")");
1629
1704
  }
1630
1705
  }
1631
- CteBlockExpr.type = ExprType.CteBlock;
1632
1706
  /**
1633
1707
  * Describe a name reference to a CTE block.
1634
1708
  * @alpha
1635
1709
  */
1636
1710
  export class CteBlockRefExpr extends ClassRefExpr {
1711
+ name;
1712
+ alias;
1713
+ static type = ExprType.CteBlockRef;
1637
1714
  constructor(name, alias) {
1638
1715
  super(CteBlockRefExpr.type);
1639
1716
  this.name = name;
@@ -1655,12 +1732,15 @@ export class CteBlockRefExpr extends ClassRefExpr {
1655
1732
  }
1656
1733
  }
1657
1734
  }
1658
- CteBlockRefExpr.type = ExprType.CteBlockRef;
1659
1735
  /**
1660
1736
  * Describe a table value function expression in ECSQL that appear in FROM clause of query.
1661
1737
  * @alpha
1662
1738
  */
1663
1739
  export class TableValuedFuncExpr extends ClassRefExpr {
1740
+ schemaName;
1741
+ memberFunc;
1742
+ alias;
1743
+ static type = ExprType.TableValuedFunc;
1664
1744
  constructor(schemaName, memberFunc, alias) {
1665
1745
  super(TableValuedFuncExpr.type);
1666
1746
  this.schemaName = schemaName;
@@ -1686,12 +1766,18 @@ export class TableValuedFuncExpr extends ClassRefExpr {
1686
1766
  }
1687
1767
  }
1688
1768
  }
1689
- TableValuedFuncExpr.type = ExprType.TableValuedFunc;
1690
1769
  /**
1691
1770
  * Describe a class name reference in ECSQL that appear in FROM clause of a SELECT.
1692
1771
  * @alpha
1693
1772
  */
1694
1773
  export class ClassNameExpr extends ClassRefExpr {
1774
+ schemaNameOrAlias;
1775
+ className;
1776
+ tablespace;
1777
+ alias;
1778
+ polymorphicInfo;
1779
+ memberFunc;
1780
+ static type = ExprType.ClassName;
1695
1781
  constructor(schemaNameOrAlias, className, tablespace, alias, polymorphicInfo, memberFunc) {
1696
1782
  super(ClassNameExpr.type);
1697
1783
  this.schemaNameOrAlias = schemaNameOrAlias;
@@ -1762,12 +1848,16 @@ export class ClassNameExpr extends ClassRefExpr {
1762
1848
  return new ClassNameExpr(schemaOrAlias, className, tablespace, alias, polyInfo);
1763
1849
  }
1764
1850
  }
1765
- ClassNameExpr.type = ExprType.ClassName;
1766
1851
  /**
1767
1852
  * Describe a UPDATE statement in ECSQL.
1768
1853
  * @alpha
1769
1854
  */
1770
1855
  export class UpdateStatementExpr extends StatementExpr {
1856
+ className;
1857
+ assignement;
1858
+ where;
1859
+ options;
1860
+ static type = ExprType.UpdateStatement;
1771
1861
  constructor(className, assignement, where, options) {
1772
1862
  super(UpdateStatementExpr.type);
1773
1863
  this.className = className;
@@ -1809,12 +1899,13 @@ export class UpdateStatementExpr extends StatementExpr {
1809
1899
  }
1810
1900
  }
1811
1901
  }
1812
- UpdateStatementExpr.type = ExprType.UpdateStatement;
1813
1902
  /**
1814
1903
  * Describe ECSQL option clause.
1815
1904
  * @alpha
1816
1905
  */
1817
1906
  export class ECSqlOptionsClauseExpr extends Expr {
1907
+ options;
1908
+ static type = ExprType.ECSqlOptionsClause;
1818
1909
  constructor(options) {
1819
1910
  super(ECSqlOptionsClauseExpr.type);
1820
1911
  this.options = options;
@@ -1843,12 +1934,14 @@ export class ECSqlOptionsClauseExpr extends Expr {
1843
1934
  });
1844
1935
  }
1845
1936
  }
1846
- ECSqlOptionsClauseExpr.type = ExprType.ECSqlOptionsClause;
1847
1937
  /**
1848
1938
  * A single property value assignment for update clause
1849
1939
  * @alpha
1850
1940
  */
1851
1941
  export class AssignmentExpr extends Expr {
1942
+ propertyName;
1943
+ valueExpr;
1944
+ static type = ExprType.Assignment;
1852
1945
  constructor(propertyName, valueExpr) {
1853
1946
  super(SetClauseExpr.type);
1854
1947
  this.propertyName = propertyName;
@@ -1869,12 +1962,13 @@ export class AssignmentExpr extends Expr {
1869
1962
  writer.appendExp(this.valueExpr);
1870
1963
  }
1871
1964
  }
1872
- AssignmentExpr.type = ExprType.Assignment;
1873
1965
  /**
1874
1966
  * Describe a set clause in a UPDATE statement
1875
1967
  * @alpha
1876
1968
  */
1877
1969
  export class SetClauseExpr extends Expr {
1970
+ assignments;
1971
+ static type = ExprType.SetClause;
1878
1972
  constructor(assignments) {
1879
1973
  super(SetClauseExpr.type);
1880
1974
  this.assignments = assignments;
@@ -1904,12 +1998,15 @@ export class SetClauseExpr extends Expr {
1904
1998
  });
1905
1999
  }
1906
2000
  }
1907
- SetClauseExpr.type = ExprType.SetClause;
1908
2001
  /**
1909
2002
  * Describe a strong typed IIF function in ECSQL
1910
2003
  * @alpha
1911
2004
  */
1912
2005
  export class IIFExpr extends ValueExpr {
2006
+ whenExpr;
2007
+ thenExpr;
2008
+ elseExpr;
2009
+ static type = ExprType.IIF;
1913
2010
  constructor(whenExpr, thenExpr, elseExpr) {
1914
2011
  super(IIFExpr.type);
1915
2012
  this.whenExpr = whenExpr;
@@ -1936,12 +2033,14 @@ export class IIFExpr extends ValueExpr {
1936
2033
  writer.append(")");
1937
2034
  }
1938
2035
  }
1939
- IIFExpr.type = ExprType.IIF;
1940
2036
  /**
1941
2037
  * Describe a CASE-WHEN-THEN expression in ECSQL
1942
2038
  * @alpha
1943
2039
  */
1944
2040
  export class SearchCaseExpr extends ValueExpr {
2041
+ whenThenList;
2042
+ elseExpr;
2043
+ static type = ExprType.SearchCase;
1945
2044
  constructor(whenThenList, elseExpr) {
1946
2045
  super(SearchCaseExpr.type);
1947
2046
  this.whenThenList = whenThenList;
@@ -1992,12 +2091,15 @@ export class SearchCaseExpr extends ValueExpr {
1992
2091
  writer.appendKeyword("END");
1993
2092
  }
1994
2093
  }
1995
- SearchCaseExpr.type = ExprType.SearchCase;
1996
2094
  /**
1997
2095
  * Describe a binary value expression
1998
2096
  * @alpha
1999
2097
  */
2000
2098
  export class BinaryValueExpr extends ValueExpr {
2099
+ op;
2100
+ lhsExpr;
2101
+ rhsExpr;
2102
+ static type = ExprType.BinaryValue;
2001
2103
  constructor(op, lhsExpr, rhsExpr) {
2002
2104
  super(BinaryValueExpr.type);
2003
2105
  this.op = op;
@@ -2021,12 +2123,14 @@ export class BinaryValueExpr extends ValueExpr {
2021
2123
  writer.append(")");
2022
2124
  }
2023
2125
  }
2024
- BinaryValueExpr.type = ExprType.BinaryValue;
2025
2126
  /**
2026
2127
  * Cast a expression into a target time e.g. CAST(<expr> AS STRING)
2027
2128
  * @alpha
2028
2129
  */
2029
2130
  export class CastExpr extends ValueExpr {
2131
+ valueExpr;
2132
+ targetType;
2133
+ static type = ExprType.Cast;
2030
2134
  constructor(valueExpr, targetType) {
2031
2135
  super(CastExpr.type);
2032
2136
  this.valueExpr = valueExpr;
@@ -2052,12 +2156,14 @@ export class CastExpr extends ValueExpr {
2052
2156
  writer.append(")");
2053
2157
  }
2054
2158
  }
2055
- CastExpr.type = ExprType.Cast;
2056
2159
  /**
2057
2160
  * Represent a member function called w.r.t a ClassNameExpr
2058
2161
  * @alpha
2059
2162
  */
2060
2163
  export class MemberFuncCallExpr extends Expr {
2164
+ functionName;
2165
+ args;
2166
+ static type = ExprType.MemberFuncCall;
2061
2167
  constructor(functionName, args) {
2062
2168
  super(MemberFuncCallExpr.type);
2063
2169
  this.functionName = functionName;
@@ -2085,12 +2191,15 @@ export class MemberFuncCallExpr extends Expr {
2085
2191
  writer.append(")");
2086
2192
  }
2087
2193
  }
2088
- MemberFuncCallExpr.type = ExprType.MemberFuncCall;
2089
2194
  /**
2090
2195
  * Represent a function call in ecsql
2091
2196
  * @alpha
2092
2197
  */
2093
2198
  export class FuncCallExpr extends ValueExpr {
2199
+ functionName;
2200
+ args;
2201
+ allOrDistinct;
2202
+ static type = ExprType.FuncCall;
2094
2203
  constructor(functionName, args, allOrDistinct) {
2095
2204
  super(FuncCallExpr.type);
2096
2205
  this.functionName = functionName;
@@ -2226,12 +2335,13 @@ export class FuncCallExpr extends ValueExpr {
2226
2335
  return new FuncCallExpr("EC_INSTANCEOF", [arg0, arg1]);
2227
2336
  }
2228
2337
  }
2229
- FuncCallExpr.type = ExprType.FuncCall;
2230
2338
  /**
2231
2339
  * Represent positional or named parameter
2232
2340
  * @alpha
2233
2341
  */
2234
2342
  export class ParameterExpr extends ValueExpr {
2343
+ name;
2344
+ static type = ExprType.Parameter;
2235
2345
  constructor(name) {
2236
2346
  super(ParameterExpr.type);
2237
2347
  this.name = name;
@@ -2252,12 +2362,14 @@ export class ParameterExpr extends ValueExpr {
2252
2362
  writer.append(`?`);
2253
2363
  }
2254
2364
  }
2255
- ParameterExpr.type = ExprType.Parameter;
2256
2365
  /**
2257
2366
  * Unary value with operator e.g. [+|-|~]<number>
2258
2367
  * @alpha
2259
2368
  */
2260
2369
  export class UnaryValueExpr extends ValueExpr {
2370
+ op;
2371
+ valueExpr;
2372
+ static type = ExprType.Unary;
2261
2373
  constructor(op, valueExpr) {
2262
2374
  super(UnaryValueExpr.type);
2263
2375
  this.op = op;
@@ -2280,12 +2392,14 @@ export class UnaryValueExpr extends ValueExpr {
2280
2392
  writer.appendExp(this.valueExpr);
2281
2393
  }
2282
2394
  }
2283
- UnaryValueExpr.type = ExprType.Unary;
2284
2395
  /**
2285
2396
  * Represent constant literal like string, data, time, timestamp, number or null
2286
2397
  * @alpha
2287
2398
  */
2288
2399
  export class LiteralExpr extends ValueExpr {
2400
+ valueType;
2401
+ rawValue;
2402
+ static type = ExprType.Literal;
2289
2403
  constructor(valueType, rawValue) {
2290
2404
  super(LiteralExpr.type);
2291
2405
  this.valueType = valueType;
@@ -2322,12 +2436,13 @@ export class LiteralExpr extends ValueExpr {
2322
2436
  static makeTimestamp(val) { return new LiteralExpr(LiteralValueType.String, val.toTimeString()); }
2323
2437
  static makeNull() { return new LiteralExpr(LiteralValueType.Null, ""); }
2324
2438
  }
2325
- LiteralExpr.type = ExprType.Literal;
2326
2439
  /**
2327
2440
  * Represent property name identifier
2328
2441
  * @alpha
2329
2442
  */
2330
2443
  export class PropertyNameExpr extends ValueExpr {
2444
+ propertyPath;
2445
+ static type = ExprType.PropertyName;
2331
2446
  constructor(propertyPath) {
2332
2447
  super(PropertyNameExpr.type);
2333
2448
  this.propertyPath = propertyPath;
@@ -2351,12 +2466,17 @@ export class PropertyNameExpr extends ValueExpr {
2351
2466
  writer.append(str[str.length - 1].split(".").map((v) => v.startsWith("[") || v === "$" ? v : `[${v}]`).join("."));
2352
2467
  }
2353
2468
  }
2354
- PropertyNameExpr.type = ExprType.PropertyName;
2355
2469
  /**
2356
2470
  * Represent navigation value creation function
2357
2471
  * @alpha
2358
2472
  */
2359
2473
  export class NavValueCreationFuncExpr extends ValueExpr {
2474
+ columnRefExp;
2475
+ idArgExp;
2476
+ classNameExp;
2477
+ relECClassIdExp;
2478
+ static type = ExprType.NavValueCreationFunc;
2479
+ static navValueCreationFuncExprName = "NAVIGATION_VALUE";
2360
2480
  constructor(columnRefExp, idArgExp, classNameExp, relECClassIdExp) {
2361
2481
  super(NavValueCreationFuncExpr.type);
2362
2482
  this.columnRefExp = columnRefExp;
@@ -2391,6 +2511,4 @@ export class NavValueCreationFuncExpr extends ValueExpr {
2391
2511
  return new NavValueCreationFuncExpr(DerivedPropertyExpr.deserialize(node.ColumnRefExp), ValueExpr.deserialize(node.IdArgExp), ClassNameExpr.deserialize(node.ClassNameExp), node.RelECClassIdExp ? ValueExpr.deserialize(node.RelECClassIdExp) : undefined);
2392
2512
  }
2393
2513
  }
2394
- NavValueCreationFuncExpr.type = ExprType.NavValueCreationFunc;
2395
- NavValueCreationFuncExpr.navValueCreationFuncExprName = "NAVIGATION_VALUE";
2396
2514
  //# sourceMappingURL=ECSqlAst.js.map