@itwin/core-backend 5.13.0-dev.9 → 5.14.0-dev.1

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.
Files changed (235) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/lib/cjs/Category.d.ts +4 -4
  3. package/lib/cjs/Category.js.map +1 -1
  4. package/lib/cjs/ChangesetECAdaptor.d.ts +5 -0
  5. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  6. package/lib/cjs/ChangesetECAdaptor.js +13 -3
  7. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  8. package/lib/cjs/CodeSpecs.d.ts +3 -3
  9. package/lib/cjs/CodeSpecs.js.map +1 -1
  10. package/lib/cjs/DisplayStyle.d.ts +2 -2
  11. package/lib/cjs/DisplayStyle.js.map +1 -1
  12. package/lib/cjs/EditTxn.d.ts.map +1 -1
  13. package/lib/cjs/EditTxn.js +1 -0
  14. package/lib/cjs/EditTxn.js.map +1 -1
  15. package/lib/cjs/Element.d.ts +48 -12
  16. package/lib/cjs/Element.d.ts.map +1 -1
  17. package/lib/cjs/Element.js +120 -24
  18. package/lib/cjs/Element.js.map +1 -1
  19. package/lib/cjs/IModelDb.d.ts +30 -15
  20. package/lib/cjs/IModelDb.d.ts.map +1 -1
  21. package/lib/cjs/IModelDb.js +51 -15
  22. package/lib/cjs/IModelDb.js.map +1 -1
  23. package/lib/cjs/Model.d.ts +5 -5
  24. package/lib/cjs/Model.d.ts.map +1 -1
  25. package/lib/cjs/Model.js.map +1 -1
  26. package/lib/cjs/PropertyStore.js +1 -1
  27. package/lib/cjs/PropertyStore.js.map +1 -1
  28. package/lib/cjs/SchemaSync.d.ts +37 -9
  29. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  30. package/lib/cjs/SchemaSync.js +125 -6
  31. package/lib/cjs/SchemaSync.js.map +1 -1
  32. package/lib/cjs/SynchronousChannel.d.ts +62 -0
  33. package/lib/cjs/SynchronousChannel.d.ts.map +1 -0
  34. package/lib/cjs/SynchronousChannel.js +11 -0
  35. package/lib/cjs/SynchronousChannel.js.map +1 -0
  36. package/lib/cjs/Texture.d.ts +1 -1
  37. package/lib/cjs/Texture.js.map +1 -1
  38. package/lib/cjs/TxnManager.d.ts +44 -4
  39. package/lib/cjs/TxnManager.d.ts.map +1 -1
  40. package/lib/cjs/TxnManager.js +72 -14
  41. package/lib/cjs/TxnManager.js.map +1 -1
  42. package/lib/cjs/ViewDefinition.d.ts +6 -6
  43. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  44. package/lib/cjs/ViewDefinition.js.map +1 -1
  45. package/lib/cjs/annotations/LeaderGeometry.d.ts +22 -7
  46. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
  47. package/lib/cjs/annotations/LeaderGeometry.js +104 -36
  48. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  49. package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
  50. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  51. package/lib/cjs/annotations/TextAnnotationElement.js +25 -10
  52. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  53. package/lib/cjs/core-backend.d.ts +1 -0
  54. package/lib/cjs/core-backend.d.ts.map +1 -1
  55. package/lib/cjs/core-backend.js +1 -0
  56. package/lib/cjs/core-backend.js.map +1 -1
  57. package/lib/cjs/internal/IntegrityCheck.d.ts +22 -0
  58. package/lib/cjs/internal/IntegrityCheck.d.ts.map +1 -1
  59. package/lib/cjs/internal/IntegrityCheck.js +13 -0
  60. package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
  61. package/lib/cjs/internal/NoReservations.d.ts +6 -0
  62. package/lib/cjs/internal/NoReservations.d.ts.map +1 -0
  63. package/lib/cjs/internal/NoReservations.js +21 -0
  64. package/lib/cjs/internal/NoReservations.js.map +1 -0
  65. package/lib/cjs/internal/SchemaSyncReservations.d.ts +4 -0
  66. package/lib/cjs/internal/SchemaSyncReservations.d.ts.map +1 -0
  67. package/lib/cjs/internal/SchemaSyncReservations.js +118 -0
  68. package/lib/cjs/internal/SchemaSyncReservations.js.map +1 -0
  69. package/lib/cjs/internal/Symbols.d.ts +1 -0
  70. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  71. package/lib/cjs/internal/Symbols.js +2 -1
  72. package/lib/cjs/internal/Symbols.js.map +1 -1
  73. package/lib/esm/Category.d.ts +4 -4
  74. package/lib/esm/Category.js.map +1 -1
  75. package/lib/esm/ChangesetECAdaptor.d.ts +5 -0
  76. package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
  77. package/lib/esm/ChangesetECAdaptor.js +13 -3
  78. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  79. package/lib/esm/CodeSpecs.d.ts +3 -3
  80. package/lib/esm/CodeSpecs.js.map +1 -1
  81. package/lib/esm/DisplayStyle.d.ts +2 -2
  82. package/lib/esm/DisplayStyle.js.map +1 -1
  83. package/lib/esm/EditTxn.d.ts.map +1 -1
  84. package/lib/esm/EditTxn.js +1 -0
  85. package/lib/esm/EditTxn.js.map +1 -1
  86. package/lib/esm/Element.d.ts +48 -12
  87. package/lib/esm/Element.d.ts.map +1 -1
  88. package/lib/esm/Element.js +121 -25
  89. package/lib/esm/Element.js.map +1 -1
  90. package/lib/esm/IModelDb.d.ts +30 -15
  91. package/lib/esm/IModelDb.d.ts.map +1 -1
  92. package/lib/esm/IModelDb.js +52 -16
  93. package/lib/esm/IModelDb.js.map +1 -1
  94. package/lib/esm/Model.d.ts +5 -5
  95. package/lib/esm/Model.d.ts.map +1 -1
  96. package/lib/esm/Model.js.map +1 -1
  97. package/lib/esm/PropertyStore.js +1 -1
  98. package/lib/esm/PropertyStore.js.map +1 -1
  99. package/lib/esm/SchemaSync.d.ts +37 -9
  100. package/lib/esm/SchemaSync.d.ts.map +1 -1
  101. package/lib/esm/SchemaSync.js +127 -8
  102. package/lib/esm/SchemaSync.js.map +1 -1
  103. package/lib/esm/SynchronousChannel.d.ts +62 -0
  104. package/lib/esm/SynchronousChannel.d.ts.map +1 -0
  105. package/lib/esm/SynchronousChannel.js +9 -0
  106. package/lib/esm/SynchronousChannel.js.map +1 -0
  107. package/lib/esm/Texture.d.ts +1 -1
  108. package/lib/esm/Texture.js.map +1 -1
  109. package/lib/esm/TxnManager.d.ts +44 -4
  110. package/lib/esm/TxnManager.d.ts.map +1 -1
  111. package/lib/esm/TxnManager.js +72 -14
  112. package/lib/esm/TxnManager.js.map +1 -1
  113. package/lib/esm/ViewDefinition.d.ts +6 -6
  114. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  115. package/lib/esm/ViewDefinition.js.map +1 -1
  116. package/lib/esm/annotations/LeaderGeometry.d.ts +22 -7
  117. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
  118. package/lib/esm/annotations/LeaderGeometry.js +104 -36
  119. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  120. package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
  121. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  122. package/lib/esm/annotations/TextAnnotationElement.js +25 -10
  123. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  124. package/lib/esm/core-backend.d.ts +1 -0
  125. package/lib/esm/core-backend.d.ts.map +1 -1
  126. package/lib/esm/core-backend.js +1 -0
  127. package/lib/esm/core-backend.js.map +1 -1
  128. package/lib/esm/internal/IntegrityCheck.d.ts +22 -0
  129. package/lib/esm/internal/IntegrityCheck.d.ts.map +1 -1
  130. package/lib/esm/internal/IntegrityCheck.js +13 -0
  131. package/lib/esm/internal/IntegrityCheck.js.map +1 -1
  132. package/lib/esm/internal/NoReservations.d.ts +6 -0
  133. package/lib/esm/internal/NoReservations.d.ts.map +1 -0
  134. package/lib/esm/internal/NoReservations.js +18 -0
  135. package/lib/esm/internal/NoReservations.js.map +1 -0
  136. package/lib/esm/internal/SchemaSyncReservations.d.ts +4 -0
  137. package/lib/esm/internal/SchemaSyncReservations.d.ts.map +1 -0
  138. package/lib/esm/internal/SchemaSyncReservations.js +115 -0
  139. package/lib/esm/internal/SchemaSyncReservations.js.map +1 -0
  140. package/lib/esm/internal/Symbols.d.ts +1 -0
  141. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  142. package/lib/esm/internal/Symbols.js +1 -0
  143. package/lib/esm/internal/Symbols.js.map +1 -1
  144. package/lib/esm/test/IModelTestUtils.d.ts +1 -1
  145. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  146. package/lib/esm/test/IModelTestUtils.js +8 -3
  147. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  148. package/lib/esm/test/annotations/LeaderGeometry.test.js +178 -2
  149. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  150. package/lib/esm/test/annotations/TextAnnotation.test.js +48 -18
  151. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  152. package/lib/esm/test/ecdb/ECSqlStatement.test.js +177 -0
  153. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  154. package/lib/esm/test/ecdb/QueryReaders.test.js +2 -16
  155. package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
  156. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +2 -2
  157. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  158. package/lib/esm/test/element/ElementRoundTrip.test.js +80 -2
  159. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  160. package/lib/esm/test/imodel/IModelECSql.test.d.ts +2 -0
  161. package/lib/esm/test/imodel/IModelECSql.test.d.ts.map +1 -0
  162. package/lib/esm/test/imodel/IModelECSql.test.js +367 -0
  163. package/lib/esm/test/imodel/IModelECSql.test.js.map +1 -0
  164. package/lib/esm/test/imodel/IModelElements.test.d.ts +2 -0
  165. package/lib/esm/test/imodel/IModelElements.test.d.ts.map +1 -0
  166. package/lib/esm/test/imodel/IModelElements.test.js +969 -0
  167. package/lib/esm/test/imodel/IModelElements.test.js.map +1 -0
  168. package/lib/esm/test/imodel/IModelGeolocation.test.d.ts +2 -0
  169. package/lib/esm/test/imodel/IModelGeolocation.test.d.ts.map +1 -0
  170. package/lib/esm/test/imodel/IModelGeolocation.test.js +539 -0
  171. package/lib/esm/test/imodel/IModelGeolocation.test.js.map +1 -0
  172. package/lib/esm/test/imodel/IModelLifecycle.test.d.ts +2 -0
  173. package/lib/esm/test/imodel/IModelLifecycle.test.d.ts.map +1 -0
  174. package/lib/esm/test/imodel/IModelLifecycle.test.js +499 -0
  175. package/lib/esm/test/imodel/IModelLifecycle.test.js.map +1 -0
  176. package/lib/esm/test/imodel/IModelMetadata.test.d.ts +2 -0
  177. package/lib/esm/test/imodel/IModelMetadata.test.d.ts.map +1 -0
  178. package/lib/esm/test/imodel/IModelMetadata.test.js +274 -0
  179. package/lib/esm/test/imodel/IModelMetadata.test.js.map +1 -0
  180. package/lib/esm/test/imodel/IModelModels.test.d.ts +2 -0
  181. package/lib/esm/test/imodel/IModelModels.test.d.ts.map +1 -0
  182. package/lib/esm/test/imodel/IModelModels.test.js +357 -0
  183. package/lib/esm/test/imodel/IModelModels.test.js.map +1 -0
  184. package/lib/esm/test/imodel/IModelRelationships.test.d.ts +2 -0
  185. package/lib/esm/test/imodel/IModelRelationships.test.d.ts.map +1 -0
  186. package/lib/esm/test/imodel/IModelRelationships.test.js +407 -0
  187. package/lib/esm/test/imodel/IModelRelationships.test.js.map +1 -0
  188. package/lib/esm/test/imodel/IModelTestFixtures.d.ts +53 -0
  189. package/lib/esm/test/imodel/IModelTestFixtures.d.ts.map +1 -0
  190. package/lib/esm/test/imodel/IModelTestFixtures.js +107 -0
  191. package/lib/esm/test/imodel/IModelTestFixtures.js.map +1 -0
  192. package/lib/esm/test/imodel/IModelViews.test.d.ts +2 -0
  193. package/lib/esm/test/imodel/IModelViews.test.d.ts.map +1 -0
  194. package/lib/esm/test/imodel/IModelViews.test.js +199 -0
  195. package/lib/esm/test/imodel/IModelViews.test.js.map +1 -0
  196. package/lib/esm/test/index.d.ts +0 -1
  197. package/lib/esm/test/index.d.ts.map +1 -1
  198. package/lib/esm/test/index.js +0 -1
  199. package/lib/esm/test/index.js.map +1 -1
  200. package/lib/esm/test/standalone/ChangesetReader.test.js +8 -26
  201. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  202. package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts +2 -0
  203. package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts.map +1 -0
  204. package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js +263 -0
  205. package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js.map +1 -0
  206. package/lib/esm/test/standalone/GeometryStream.test.js +1 -3
  207. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  208. package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
  209. package/lib/esm/test/standalone/IModelWrite.test.js +78 -1
  210. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  211. package/lib/esm/test/standalone/IntegrityCheck.test.js +29 -10
  212. package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
  213. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +23 -0
  214. package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -1
  215. package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts +2 -0
  216. package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts.map +1 -0
  217. package/lib/esm/test/standalone/SchemaSyncDb.test.js +221 -0
  218. package/lib/esm/test/standalone/SchemaSyncDb.test.js.map +1 -0
  219. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts +2 -0
  220. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts.map +1 -0
  221. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js +459 -0
  222. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js.map +1 -0
  223. package/lib/esm/test/standalone/SnapshotDb.test.js +1 -0
  224. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  225. package/lib/esm/test/standalone/TxnManager.test.js +108 -8
  226. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  227. package/package.json +14 -17
  228. package/lib/esm/test/RevisionUtility.d.ts +0 -33
  229. package/lib/esm/test/RevisionUtility.d.ts.map +0 -1
  230. package/lib/esm/test/RevisionUtility.js +0 -52
  231. package/lib/esm/test/RevisionUtility.js.map +0 -1
  232. package/lib/esm/test/imodel/IModel.test.d.ts +0 -2
  233. package/lib/esm/test/imodel/IModel.test.d.ts.map +0 -1
  234. package/lib/esm/test/imodel/IModel.test.js +0 -3277
  235. package/lib/esm/test/imodel/IModel.test.js.map +0 -1
@@ -3563,5 +3563,182 @@ describe("ECSqlStatement", () => {
3563
3563
  testECSqlWithBinders(11, "SELECT * from test.Child where Friends = ? and Parent = ?", "Test.ParentHasChildren", "Test.ChildHasFriends", true, "", false);
3564
3564
  });
3565
3565
  });
3566
+ describe("IS / IS NOT operators between operands", () => {
3567
+ it("compares primitive operands with null-safe semantics", async () => {
3568
+ const env_36 = { stack: [], error: void 0, hasError: false };
3569
+ try {
3570
+ const ecdb = __addDisposableResource(env_36, ECDbTestHelper.createECDb(outDir, "isOperatorNullSafe.ecdb", `<ECSchema schemaName="TestSchema" alias="ts" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.1">
3571
+ <ECEntityClass typeName="Foo" modifier="None">
3572
+ <ECProperty propertyName="S1" typeName="string"/>
3573
+ <ECProperty propertyName="S2" typeName="string"/>
3574
+ <ECProperty propertyName="P1" typeName="point3d"/>
3575
+ </ECEntityClass>
3576
+ </ECSchema>`), false);
3577
+ assert.isTrue(ecdb.isOpen);
3578
+ const insert = (ecsql) => {
3579
+ const res = ecdb.withCachedWriteStatement(ecsql, (stmt) => stmt.stepForInsert());
3580
+ assert.equal(res.status, DbResult.BE_SQLITE_DONE);
3581
+ };
3582
+ // (S1, S2): equal-nonnull, different, both-null, one-null, the-other-null
3583
+ insert("INSERT INTO ts.Foo(S1,S2) VALUES('a','a')");
3584
+ insert("INSERT INTO ts.Foo(S1,S2) VALUES('a','b')");
3585
+ insert("INSERT INTO ts.Foo(S1,S2) VALUES(NULL,NULL)");
3586
+ insert("INSERT INTO ts.Foo(S1,S2) VALUES(NULL,'b')");
3587
+ insert("INSERT INTO ts.Foo(S1,S2) VALUES('a',NULL)");
3588
+ ecdb.saveChanges();
3589
+ // null-safe equality: matches ('a','a') and (NULL,NULL)
3590
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS S2"), 2);
3591
+ // null-safe inequality: matches ('a','b'), (NULL,'b'), ('a',NULL)
3592
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS NOT S2"), 3);
3593
+ // contrast: regular '=' treats NULL comparisons as unknown -> only ('a','a')
3594
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 = S2"), 1);
3595
+ // NULL literal operand on either side keeps the existing IS NULL / IS NOT NULL behavior
3596
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS NULL"), 2);
3597
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS NOT NULL"), 3);
3598
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE NULL IS S2"), 2);
3599
+ // The operands may be ANY value expression, not just a property or the NULL literal.
3600
+ // String literal operand: matches rows where S1 IS 'a' (null-safe).
3601
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS 'a'"), 3);
3602
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS NOT 'a'"), 2);
3603
+ // Function call operand (LOWER(S2) equals S2 for these lowercase values).
3604
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS LOWER(S2)"), 2);
3605
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS NOT LOWER(S2)"), 3);
3606
+ // Function call on the left-hand side.
3607
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE LOWER(S1) IS S2"), 2);
3608
+ // A parenthesized *unqualified* name is a value expression here, not an IS (ClassName) type predicate:
3609
+ // `S2` is a property, so `S1 IS (S2)` is the null-safe value comparison `S1 IS S2` and matches the same
3610
+ // 2 rows. The type-predicate form is taken only for a *qualified* class name (e.g. `ts.Foo`), an ONLY/ALL
3611
+ // prefix, or a comma-separated class list, as in the `ECClassId IS (ts.Foo)` regression check below. A
3612
+ // qualified name that does not resolve to a class is also a value expression; when a qualified name is both
3613
+ // a valid class and a valid property path, the type-predicate (class) reading takes precedence.
3614
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS (S2)"), 2);
3615
+ // Parameter operand, bound to a value and to NULL (null-safe either way).
3616
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS ?", new QueryBinder().bindString(1, "a")), 3);
3617
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS ?", new QueryBinder().bindNull(1)), 2);
3618
+ // Regression: the IS (ClassName) type predicate is unaffected (all rows are ts.Foo).
3619
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE ECClassId IS (ts.Foo)"), 5);
3620
+ // Operands of incompatible types are rejected at prepare time (string vs point) — assert the
3621
+ // specific type-mismatch failure so the test proves IS was rejected for the intended reason
3622
+ // rather than passing on any unrelated error (e.g. a typo or schema-setup failure).
3623
+ let error;
3624
+ try {
3625
+ await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE S1 IS P1");
3626
+ }
3627
+ catch (err) {
3628
+ error = err;
3629
+ }
3630
+ assert.isDefined(error, "IS between incompatible types (string vs point) should fail to prepare");
3631
+ assert.match(error.message, /Type mismatch in expression '\[S1\] IS \[P1\]'/, "IS should be rejected for the type mismatch, not an unrelated failure");
3632
+ }
3633
+ catch (e_36) {
3634
+ env_36.error = e_36;
3635
+ env_36.hasError = true;
3636
+ }
3637
+ finally {
3638
+ __disposeResources(env_36);
3639
+ }
3640
+ });
3641
+ it("expands point operands column-wise (IS joins with AND, IS NOT with OR)", async () => {
3642
+ const env_37 = { stack: [], error: void 0, hasError: false };
3643
+ try {
3644
+ const ecdb = __addDisposableResource(env_37, ECDbTestHelper.createECDb(outDir, "isOperatorPoints.ecdb", `<ECSchema schemaName="TestSchema" alias="ts" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.1">
3645
+ <ECEntityClass typeName="Foo" modifier="None">
3646
+ <ECProperty propertyName="P1" typeName="point3d"/>
3647
+ <ECProperty propertyName="P2" typeName="point3d"/>
3648
+ </ECEntityClass>
3649
+ </ECSchema>`), false);
3650
+ assert.isTrue(ecdb.isOpen);
3651
+ const insertPoints = (p1, p2) => {
3652
+ ecdb.withCachedWriteStatement("INSERT INTO ts.Foo(P1,P2) VALUES(?,?)", (stmt) => {
3653
+ if (p1)
3654
+ stmt.bindPoint3d(1, p1);
3655
+ else
3656
+ stmt.bindNull(1);
3657
+ if (p2)
3658
+ stmt.bindPoint3d(2, p2);
3659
+ else
3660
+ stmt.bindNull(2);
3661
+ assert.equal(stmt.stepForInsert().status, DbResult.BE_SQLITE_DONE);
3662
+ });
3663
+ };
3664
+ insertPoints(new Point3d(1, 2, 3), new Point3d(1, 2, 3)); // all columns equal
3665
+ insertPoints(new Point3d(1, 2, 3), new Point3d(1, 2, 9)); // differ in Z only
3666
+ insertPoints(undefined, undefined); // both NULL (all columns NULL)
3667
+ insertPoints(new Point3d(1, 2, 3), undefined); // one operand NULL
3668
+ ecdb.saveChanges();
3669
+ // IS is true only when every column matches (null-safe): equal point + both-null
3670
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE P1 IS P2"), 2);
3671
+ // IS NOT is true when any column differs: differ-in-Z + one-null
3672
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Foo WHERE P1 IS NOT P2"), 2);
3673
+ }
3674
+ catch (e_37) {
3675
+ env_37.error = e_37;
3676
+ env_37.hasError = true;
3677
+ }
3678
+ finally {
3679
+ __disposeResources(env_37);
3680
+ }
3681
+ });
3682
+ it("expands navigation operands column-wise over Id and RelECClassId", async () => {
3683
+ const env_38 = { stack: [], error: void 0, hasError: false };
3684
+ try {
3685
+ const ecdb = __addDisposableResource(env_38, ECDbTestHelper.createECDb(outDir, "isOperatorNav.ecdb", `<ECSchema schemaName="TestSchema" alias="ts" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.1">
3686
+ <ECEntityClass typeName="Parent" modifier="None">
3687
+ <ECProperty propertyName="Name" typeName="string"/>
3688
+ </ECEntityClass>
3689
+ <ECEntityClass typeName="Child" modifier="None">
3690
+ <ECNavigationProperty propertyName="ParentA" relationshipName="ParentAOwnsChildren" direction="Backward"/>
3691
+ <ECNavigationProperty propertyName="ParentB" relationshipName="ParentBRefsChildren" direction="Backward"/>
3692
+ </ECEntityClass>
3693
+ <ECRelationshipClass typeName="ParentAOwnsChildren" strength="embedding" modifier="None">
3694
+ <Source multiplicity="(0..1)" roleLabel="owns" polymorphic="true"><Class class="Parent"/></Source>
3695
+ <Target multiplicity="(0..*)" roleLabel="owned by" polymorphic="true"><Class class="Child"/></Target>
3696
+ </ECRelationshipClass>
3697
+ <ECRelationshipClass typeName="ParentBRefsChildren" strength="referencing" modifier="None">
3698
+ <Source multiplicity="(0..1)" roleLabel="refs" polymorphic="true"><Class class="Parent"/></Source>
3699
+ <Target multiplicity="(0..*)" roleLabel="ref by" polymorphic="true"><Class class="Child"/></Target>
3700
+ </ECRelationshipClass>
3701
+ </ECSchema>`), false);
3702
+ assert.isTrue(ecdb.isOpen);
3703
+ const parentId = ecdb.withCachedWriteStatement("INSERT INTO ts.Parent(Name) VALUES('P')", (stmt) => {
3704
+ const res = stmt.stepForInsert();
3705
+ assert.equal(res.status, DbResult.BE_SQLITE_DONE);
3706
+ return res.id;
3707
+ });
3708
+ const parentA = { id: parentId, relClassName: "TestSchema.ParentAOwnsChildren" };
3709
+ const parentB = { id: parentId, relClassName: "TestSchema.ParentBRefsChildren" };
3710
+ const insertChild = (a, b) => {
3711
+ ecdb.withCachedWriteStatement("INSERT INTO ts.Child(ParentA,ParentB) VALUES(?,?)", (stmt) => {
3712
+ if (a)
3713
+ stmt.bindNavigation(1, a);
3714
+ else
3715
+ stmt.bindNull(1);
3716
+ if (b)
3717
+ stmt.bindNavigation(2, b);
3718
+ else
3719
+ stmt.bindNull(2);
3720
+ assert.equal(stmt.stepForInsert().status, DbResult.BE_SQLITE_DONE);
3721
+ });
3722
+ };
3723
+ insertChild(undefined, undefined); // both nav values fully NULL
3724
+ insertChild(parentA, undefined); // only ParentA set
3725
+ insertChild(parentA, parentB); // same target Id but different RelECClassId
3726
+ ecdb.saveChanges();
3727
+ // IS requires both Id AND RelECClassId to match: only the both-NULL child qualifies.
3728
+ // The (parentA, parentB) child points at the same parent Id but via different
3729
+ // relationship classes, so its RelECClassId values differ and it is not "equal".
3730
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Child WHERE ParentA IS ParentB"), 1);
3731
+ // IS NOT matches when either Id OR RelECClassId differs: the other two children.
3732
+ assert.equal(await queryCount(ecdb, "SELECT ECInstanceId FROM ts.Child WHERE ParentA IS NOT ParentB"), 2);
3733
+ }
3734
+ catch (e_38) {
3735
+ env_38.error = e_38;
3736
+ env_38.hasError = true;
3737
+ }
3738
+ finally {
3739
+ __disposeResources(env_38);
3740
+ }
3741
+ });
3742
+ });
3566
3743
  });
3567
3744
  //# sourceMappingURL=ECSqlStatement.test.js.map