@itwin/core-backend 4.0.0-dev.52 → 4.0.0-dev.54

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 (265) hide show
  1. package/lib/cjs/AliCloudStorageService.d.ts +23 -23
  2. package/lib/cjs/AliCloudStorageService.js +71 -71
  3. package/lib/cjs/AliCloudStorageService.js.map +1 -1
  4. package/lib/cjs/BackendHubAccess.d.ts +224 -224
  5. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  6. package/lib/cjs/BackendHubAccess.js +41 -41
  7. package/lib/cjs/BackendHubAccess.js.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.d.ts +90 -91
  9. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  10. package/lib/cjs/BackendLoggerCategory.js +98 -99
  11. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  12. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  13. package/lib/cjs/BisCoreSchema.js +60 -60
  14. package/lib/cjs/BisCoreSchema.js.map +1 -1
  15. package/lib/cjs/BriefcaseManager.d.ts +170 -170
  16. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  17. package/lib/cjs/BriefcaseManager.js +408 -408
  18. package/lib/cjs/BriefcaseManager.js.map +1 -1
  19. package/lib/cjs/Category.d.ts +153 -153
  20. package/lib/cjs/Category.js +243 -243
  21. package/lib/cjs/Category.js.map +1 -1
  22. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  23. package/lib/cjs/ChangeSummaryManager.js +446 -446
  24. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  25. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  26. package/lib/cjs/ChangedElementsDb.js +165 -165
  27. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  28. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  29. package/lib/cjs/ChangedElementsManager.js +88 -88
  30. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  31. package/lib/cjs/ChannelControl.d.ts +69 -69
  32. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  33. package/lib/cjs/ChannelControl.js +88 -88
  34. package/lib/cjs/ChannelControl.js.map +1 -1
  35. package/lib/cjs/CheckpointManager.d.ts +121 -121
  36. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  37. package/lib/cjs/CheckpointManager.js +351 -351
  38. package/lib/cjs/CheckpointManager.js.map +1 -1
  39. package/lib/cjs/ClassRegistry.d.ts +79 -79
  40. package/lib/cjs/ClassRegistry.js +254 -249
  41. package/lib/cjs/ClassRegistry.js.map +1 -1
  42. package/lib/cjs/CloudSqlite.d.ts +355 -355
  43. package/lib/cjs/CloudSqlite.js +154 -154
  44. package/lib/cjs/CloudSqlite.js.map +1 -1
  45. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  46. package/lib/cjs/CloudStorageBackend.js +170 -170
  47. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  48. package/lib/cjs/CodeService.d.ts +396 -396
  49. package/lib/cjs/CodeService.js +63 -63
  50. package/lib/cjs/CodeService.js.map +1 -1
  51. package/lib/cjs/CodeSpecs.d.ts +55 -55
  52. package/lib/cjs/CodeSpecs.js +124 -124
  53. package/lib/cjs/CodeSpecs.js.map +1 -1
  54. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  55. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  56. package/lib/cjs/ConcurrentQuery.js +36 -36
  57. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  58. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  59. package/lib/cjs/CustomViewState3dCreator.js +82 -82
  60. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  61. package/lib/cjs/DevTools.d.ts +74 -73
  62. package/lib/cjs/DevTools.d.ts.map +1 -1
  63. package/lib/cjs/DevTools.js +156 -156
  64. package/lib/cjs/DevTools.js.map +1 -1
  65. package/lib/cjs/DisplayStyle.d.ts +106 -106
  66. package/lib/cjs/DisplayStyle.js +253 -253
  67. package/lib/cjs/DisplayStyle.js.map +1 -1
  68. package/lib/cjs/ECDb.d.ts +194 -194
  69. package/lib/cjs/ECDb.js +353 -353
  70. package/lib/cjs/ECDb.js.map +1 -1
  71. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  72. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  73. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  74. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  75. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  76. package/lib/cjs/ECSqlStatement.js +791 -791
  77. package/lib/cjs/ECSqlStatement.js.map +1 -1
  78. package/lib/cjs/Element.d.ts +1113 -1113
  79. package/lib/cjs/Element.js +1424 -1424
  80. package/lib/cjs/Element.js.map +1 -1
  81. package/lib/cjs/ElementAspect.d.ts +176 -176
  82. package/lib/cjs/ElementAspect.js +203 -203
  83. package/lib/cjs/ElementAspect.js.map +1 -1
  84. package/lib/cjs/ElementGraphics.d.ts +9 -9
  85. package/lib/cjs/ElementGraphics.js +41 -41
  86. package/lib/cjs/ElementGraphics.js.map +1 -1
  87. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  88. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  89. package/lib/cjs/ElementTreeWalker.js +409 -409
  90. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  91. package/lib/cjs/Entity.d.ts +106 -106
  92. package/lib/cjs/Entity.d.ts.map +1 -1
  93. package/lib/cjs/Entity.js +134 -134
  94. package/lib/cjs/Entity.js.map +1 -1
  95. package/lib/cjs/EntityReferences.d.ts +49 -49
  96. package/lib/cjs/EntityReferences.d.ts.map +1 -1
  97. package/lib/cjs/EntityReferences.js +95 -95
  98. package/lib/cjs/EntityReferences.js.map +1 -1
  99. package/lib/cjs/ExportGraphics.d.ts +317 -317
  100. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  101. package/lib/cjs/ExportGraphics.js +208 -208
  102. package/lib/cjs/ExportGraphics.js.map +1 -1
  103. package/lib/cjs/ExternalSource.d.ts +96 -96
  104. package/lib/cjs/ExternalSource.js +131 -131
  105. package/lib/cjs/ExternalSource.js.map +1 -1
  106. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  107. package/lib/cjs/GeoCoordConfig.js +85 -85
  108. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  109. package/lib/cjs/GeometrySummary.d.ts +4 -4
  110. package/lib/cjs/GeometrySummary.js +380 -380
  111. package/lib/cjs/GeometrySummary.js.map +1 -1
  112. package/lib/cjs/HubMock.d.ts +94 -94
  113. package/lib/cjs/HubMock.js +220 -220
  114. package/lib/cjs/HubMock.js.map +1 -1
  115. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  116. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  117. package/lib/cjs/IModelCloneContext.js +15 -15
  118. package/lib/cjs/IModelCloneContext.js.map +1 -1
  119. package/lib/cjs/IModelDb.d.ts +1216 -1216
  120. package/lib/cjs/IModelDb.d.ts.map +1 -1
  121. package/lib/cjs/IModelDb.js +2387 -2386
  122. package/lib/cjs/IModelDb.js.map +1 -1
  123. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  124. package/lib/cjs/IModelElementCloneContext.js +159 -159
  125. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  126. package/lib/cjs/IModelHost.d.ts +369 -369
  127. package/lib/cjs/IModelHost.js +488 -488
  128. package/lib/cjs/IModelHost.js.map +1 -1
  129. package/lib/cjs/IModelJsFs.d.ts +62 -62
  130. package/lib/cjs/IModelJsFs.js +139 -139
  131. package/lib/cjs/IModelJsFs.js.map +1 -1
  132. package/lib/cjs/IpcHost.d.ts +104 -104
  133. package/lib/cjs/IpcHost.js +276 -276
  134. package/lib/cjs/IpcHost.js.map +1 -1
  135. package/lib/cjs/LineStyle.d.ts +311 -311
  136. package/lib/cjs/LineStyle.js +295 -295
  137. package/lib/cjs/LineStyle.js.map +1 -1
  138. package/lib/cjs/LocalHub.d.ts +162 -162
  139. package/lib/cjs/LocalHub.d.ts.map +1 -1
  140. package/lib/cjs/LocalHub.js +580 -580
  141. package/lib/cjs/LocalHub.js.map +1 -1
  142. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  143. package/lib/cjs/LocalhostIpcHost.js +79 -79
  144. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  145. package/lib/cjs/Material.d.ts +131 -131
  146. package/lib/cjs/Material.js +180 -180
  147. package/lib/cjs/Material.js.map +1 -1
  148. package/lib/cjs/Model.d.ts +392 -392
  149. package/lib/cjs/Model.js +489 -489
  150. package/lib/cjs/Model.js.map +1 -1
  151. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  152. package/lib/cjs/NativeAppStorage.js +202 -202
  153. package/lib/cjs/NativeAppStorage.js.map +1 -1
  154. package/lib/cjs/NativeHost.d.ts +52 -52
  155. package/lib/cjs/NativeHost.js +160 -160
  156. package/lib/cjs/NativeHost.js.map +1 -1
  157. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  158. package/lib/cjs/NavigationRelationship.js +225 -225
  159. package/lib/cjs/NavigationRelationship.js.map +1 -1
  160. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  161. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  162. package/lib/cjs/PromiseMemoizer.js +101 -101
  163. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  164. package/lib/cjs/PropertyStore.d.ts +132 -132
  165. package/lib/cjs/PropertyStore.js +11 -11
  166. package/lib/cjs/PropertyStore.js.map +1 -1
  167. package/lib/cjs/Relationship.d.ts +416 -416
  168. package/lib/cjs/Relationship.js +494 -494
  169. package/lib/cjs/Relationship.js.map +1 -1
  170. package/lib/cjs/RpcBackend.d.ts +5 -5
  171. package/lib/cjs/RpcBackend.js +32 -32
  172. package/lib/cjs/RpcBackend.js.map +1 -1
  173. package/lib/cjs/SQLiteDb.d.ts +219 -219
  174. package/lib/cjs/SQLiteDb.js +212 -212
  175. package/lib/cjs/SQLiteDb.js.map +1 -1
  176. package/lib/cjs/Schema.d.ts +55 -55
  177. package/lib/cjs/Schema.js +83 -83
  178. package/lib/cjs/Schema.js.map +1 -1
  179. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  180. package/lib/cjs/ServerBasedLocks.js +168 -168
  181. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  182. package/lib/cjs/SqliteStatement.d.ts +360 -360
  183. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  184. package/lib/cjs/SqliteStatement.js +586 -586
  185. package/lib/cjs/SqliteStatement.js.map +1 -1
  186. package/lib/cjs/Texture.d.ts +58 -58
  187. package/lib/cjs/Texture.js +82 -82
  188. package/lib/cjs/Texture.js.map +1 -1
  189. package/lib/cjs/TileStorage.d.ts +18 -18
  190. package/lib/cjs/TileStorage.js +87 -87
  191. package/lib/cjs/TileStorage.js.map +1 -1
  192. package/lib/cjs/TxnManager.d.ts +202 -202
  193. package/lib/cjs/TxnManager.d.ts.map +1 -1
  194. package/lib/cjs/TxnManager.js +356 -356
  195. package/lib/cjs/TxnManager.js.map +1 -1
  196. package/lib/cjs/ViewDefinition.d.ts +435 -435
  197. package/lib/cjs/ViewDefinition.js +646 -646
  198. package/lib/cjs/ViewDefinition.js.map +1 -1
  199. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  200. package/lib/cjs/ViewStateHydrator.js +103 -103
  201. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  202. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  203. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  204. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  205. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  206. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  207. package/lib/cjs/core-backend.d.ts +185 -185
  208. package/lib/cjs/core-backend.js +209 -205
  209. package/lib/cjs/core-backend.js.map +1 -1
  210. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  211. package/lib/cjs/domains/FunctionalElements.js +145 -145
  212. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  213. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  214. package/lib/cjs/domains/FunctionalSchema.js +39 -39
  215. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  216. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  217. package/lib/cjs/domains/GenericElements.js +263 -263
  218. package/lib/cjs/domains/GenericElements.js.map +1 -1
  219. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  220. package/lib/cjs/domains/GenericSchema.js +28 -28
  221. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  222. package/lib/cjs/rpc/multipart.d.ts +11 -11
  223. package/lib/cjs/rpc/multipart.js +71 -71
  224. package/lib/cjs/rpc/multipart.js.map +1 -1
  225. package/lib/cjs/rpc/tracing.d.ts +28 -28
  226. package/lib/cjs/rpc/tracing.js +73 -73
  227. package/lib/cjs/rpc/tracing.js.map +1 -1
  228. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  229. package/lib/cjs/rpc/web/logging.js +43 -43
  230. package/lib/cjs/rpc/web/logging.js.map +1 -1
  231. package/lib/cjs/rpc/web/request.d.ts +6 -6
  232. package/lib/cjs/rpc/web/request.js +73 -73
  233. package/lib/cjs/rpc/web/request.js.map +1 -1
  234. package/lib/cjs/rpc/web/response.d.ts +6 -6
  235. package/lib/cjs/rpc/web/response.js +105 -105
  236. package/lib/cjs/rpc/web/response.js.map +1 -1
  237. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  238. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  239. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  240. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  241. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -293
  242. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  243. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  244. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
  245. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  246. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  247. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -166
  248. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  249. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  250. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -42
  251. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  252. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  253. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  254. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  255. package/lib/cjs/workspace/Settings.d.ts +186 -186
  256. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  257. package/lib/cjs/workspace/Settings.js +154 -154
  258. package/lib/cjs/workspace/Settings.js.map +1 -1
  259. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  260. package/lib/cjs/workspace/SettingsSchemas.js +190 -190
  261. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  262. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  263. package/lib/cjs/workspace/Workspace.js +537 -537
  264. package/lib/cjs/workspace/Workspace.js.map +1 -1
  265. package/package.json +12 -12
@@ -1,474 +1,474 @@
1
- /** @packageDocumentation
2
- * @module ECSQL
3
- */
4
- import { DbResult, GuidString, Id64String, IDisposable, StatusCodeWithMessage } from "@itwin/core-bentley";
5
- import { LowAndHighXYZ, XAndY, XYAndZ } from "@itwin/core-geometry";
6
- import { ECSqlValueType, NavigationBindingValue, NavigationValue } from "@itwin/core-common";
7
- import { IModelJsNative } from "@bentley/imodeljs-native";
8
- /** The result of an **ECSQL INSERT** statement as returned from [ECSqlStatement.stepForInsert]($backend).
9
- *
10
- * If the step was successful, the ECSqlInsertResult contains
11
- * [DbResult.BE_SQLITE_DONE]($core-bentley)
12
- * and the ECInstanceId of the newly created instance.
13
- * In case of failure it contains the [DbResult]($core-bentley) error code.
14
- *
15
- * > Insert statements can be used with ECDb only, not with IModelDb.
16
- * @public
17
- */
18
- export declare class ECSqlInsertResult {
19
- status: DbResult;
20
- id?: string | undefined;
21
- constructor(status: DbResult, id?: string | undefined);
22
- }
23
- /** Executes ECSQL statements.
24
- *
25
- * A statement must be prepared before it can be executed, and it must be released when no longer needed.
26
- * See [IModelDb.withPreparedStatement]($backend) or
27
- * [ECDb.withPreparedStatement]($backend) for a convenient and
28
- * reliable way to prepare, execute, and then release a statement.
29
- *
30
- * A statement may contain parameters that must be filled in before use by the **bind** methods.
31
- *
32
- * Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.step]($backend).
33
- * In case of an **ECSQL SELECT** statement, the current row can be retrieved with [ECSqlStatement.getRow]($backend) as
34
- * a whole, or with [ECSqlStatement.getValue]($backend) when individual values are needed.
35
- * Alternatively, query results of an **ECSQL SELECT** statement can be stepped through by using
36
- * standard iteration syntax, such as `for of`.
37
- *
38
- * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared
39
- * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.
40
- * > The key to making this strategy work is to phrase a statement in a general way and use placeholders to represent parameters that will vary on each use.
41
- *
42
- * See also
43
- * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
44
- * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
45
- * @public
46
- */
47
- export declare class ECSqlStatement implements IterableIterator<any>, IDisposable {
48
- private _stmt;
49
- private _sql;
50
- get sql(): string;
51
- /** Check if this statement has been prepared successfully or not */
52
- get isPrepared(): boolean;
53
- /** Prepare this statement prior to first use.
54
- * @param db The DgnDb or ECDb to prepare the statement against
55
- * @param ecsql The ECSQL statement string to prepare
56
- * @param logErrors Determine if errors are logged or not
57
- * @throws [IModelError]($common) if the ECSQL statement cannot be prepared. Normally, prepare fails due to ECSQL syntax errors or references to tables or properties that do not exist.
58
- * The error.message property will provide details.
59
- * @internal
60
- */
61
- prepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): void;
62
- /** Prepare this statement prior to first use.
63
- * @param db The DgnDb or ECDb to prepare the statement against
64
- * @param ecsql The ECSQL statement string to prepare
65
- * @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()
66
- * @returns A [StatusCodeWithMessage]($bentley) object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.
67
- * @internal
68
- */
69
- tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): StatusCodeWithMessage<DbResult>;
70
- /** Reset this statement so that the next call to step will return the first row, if any. */
71
- reset(): void;
72
- /** Get the Native SQL statement
73
- * @internal
74
- */
75
- getNativeSql(): string;
76
- /** Call this function when finished with this statement. This releases the native resources held by the statement.
77
- *
78
- * > Do not call this method directly on a statement that is being managed by a statement cache.
79
- */
80
- dispose(): void;
81
- /** Binds the specified value to the specified ECSQL parameter.
82
- * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
83
- * iTwin.js types to be used for the different ECSQL parameter types.
84
- * @param parameter Index (1-based) or name of the parameter
85
- */
86
- bindValue(parameter: number | string, val: any): void;
87
- /** Binds null to the specified ECSQL parameter.
88
- * @param parameter Index (1-based) or name of the parameter
89
- */
90
- bindNull(parameter: number | string): void;
91
- /** Binds a BLOB value to the specified ECSQL parameter.
92
- * @param parameter Index (1-based) or name of the parameter
93
- * @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string
94
- */
95
- bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
96
- /** Binds a boolean value to the specified ECSQL parameter.
97
- * @param parameter Index (1-based) or name of the parameter
98
- * @param val Boolean value
99
- */
100
- bindBoolean(parameter: number | string, val: boolean): void;
101
- /** Binds a DateTime value to the specified ECSQL parameter.
102
- * @param parameter Index (1-based) or name of the parameter
103
- * @param isoDateTimeString DateTime value as ISO8601 string
104
- */
105
- bindDateTime(parameter: number | string, isoDateTimeString: string): void;
106
- /** Binds a double value to the specified ECSQL parameter.
107
- * @param parameter Index (1-based) or name of the parameter
108
- * @param val Double value
109
- */
110
- bindDouble(parameter: number | string, val: number): void;
111
- /** Binds an GUID value to the specified ECSQL parameter.
112
- * @param parameter Index (1-based) or name of the parameter
113
- * @param val GUID value
114
- */
115
- bindGuid(parameter: number | string, val: GuidString): void;
116
- /** Binds an Id value to the specified ECSQL parameter.
117
- * @param parameter Index (1-based) or name of the parameter
118
- * @param val Id value
119
- */
120
- bindId(parameter: number | string, val: Id64String): void;
121
- /** Binds an integer value to the specified ECSQL parameter.
122
- * @param parameter Index (1-based) or name of the parameter
123
- * @param val Integer value as number, decimal string or hexadecimal string.
124
- */
125
- bindInteger(parameter: number | string, val: number | string): void;
126
- /** Binds an Point2d value to the specified ECSQL parameter.
127
- * @param parameter Index (1-based) or name of the parameter
128
- * @param val Point2d value
129
- */
130
- bindPoint2d(parameter: number | string, val: XAndY): void;
131
- /** Binds an Point3d value to the specified ECSQL parameter.
132
- * @param parameter Index (1-based) or name of the parameter
133
- * @param val Point3d value
134
- */
135
- bindPoint3d(parameter: number | string, val: XYAndZ): void;
136
- /** Binds a Range3d as a blob to the specified ECSQL parameter
137
- * @param parameter Index(1-based) or name of the parameter
138
- * @param val Range3d value
139
- */
140
- bindRange3d(parameter: number | string, val: LowAndHighXYZ): void;
141
- /** Binds an string to the specified ECSQL parameter.
142
- * @param parameter Index (1-based) or name of the parameter
143
- * @param val String value
144
- */
145
- bindString(parameter: number | string, val: string): void;
146
- /** Binds a navigation property value to the specified ECSQL parameter.
147
- * @param parameter Index (1-based) or name of the parameter
148
- * @param val Navigation property value
149
- */
150
- bindNavigation(parameter: number | string, val: NavigationBindingValue): void;
151
- /** Binds a struct property value to the specified ECSQL parameter.
152
- * @param parameter Index (1-based) or name of the parameter
153
- * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
154
- * (of one of the supported types)
155
- */
156
- bindStruct(parameter: number | string, val: object): void;
157
- /** Binds an array value to the specified ECSQL parameter.
158
- * @param parameter Index (1-based) or name of the parameter
159
- * @param val Array value. The array value is an array of values of the supported types
160
- */
161
- bindArray(parameter: number | string, val: any[]): void;
162
- bindIdSet(parameter: number | string, val: Id64String[]): void;
163
- /**
164
- * Gets a binder to bind a value for an ECSQL parameter
165
- * > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods
166
- * > or [ECSqlStatement.bindValues]($backend).
167
- * @param parameter Index (1-based) or name of the parameter
168
- */
169
- getBinder(parameter: string | number): ECSqlBinder;
170
- /** Bind values to all parameters in the statement.
171
- * @param values The values to bind to the parameters.
172
- * Pass an *array* of values if the parameters are *positional*.
173
- * Pass an *object of the values keyed on the parameter name* for *named parameters*.
174
- * The values in either the array or object must match the respective types of the parameter.
175
- *
176
- * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
177
- * iTwin.js types to be used for the different ECSQL parameter types.
178
- *
179
- * See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)
180
- */
181
- bindValues(values: any[] | object): void;
182
- /** Clear any bindings that were previously set on this statement.
183
- * @throws [IModelError]($common) in case of errors
184
- */
185
- clearBindings(): void;
186
- /** Step this statement to the next row.
187
- *
188
- * For **ECSQL SELECT** statements the method returns
189
- * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.
190
- * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.
191
- * - Error status in case of errors.
192
- *
193
- * For **ECSQL INSERT, UPDATE, DELETE** statements the method returns
194
- * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.
195
- * - Error status in case of errors.
196
- *
197
- * > Insert statements can be used with ECDb only, not with IModelDb.
198
- *
199
- * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples)
200
- */
201
- step(): DbResult;
202
- /** @internal added this back in for testing purposes */
203
- stepAsync(): Promise<DbResult>;
204
- /** Step this INSERT statement and returns status and the ECInstanceId of the newly
205
- * created instance.
206
- *
207
- * > Insert statements can be used with ECDb only, not with IModelDb.
208
- *
209
- * @returns Returns the generated ECInstanceId in case of success and the status of the step
210
- * call. In case of error, the respective error code is returned.
211
- */
212
- stepForInsert(): ECSqlInsertResult;
213
- /** Get the query result's column count (only for ECSQL SELECT statements). */
214
- getColumnCount(): number;
215
- /** Get the current row.
216
- * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.
217
- *
218
- * See also:
219
- * - [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned row.
220
- * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
221
- */
222
- getRow(): any;
223
- private static determineResultRowPropertyName;
224
- /** Calls step when called as an iterator.
225
- *
226
- * Each iteration returns an [ECSQL row format]($docs/learning/ECSQLRowFormat) as returned
227
- * from [ECSqlStatement.getRow]($backend).
228
- */
229
- next(): IteratorResult<any>;
230
- /** The iterator that will step through the results of this statement. */
231
- [Symbol.iterator](): IterableIterator<any>;
232
- /** Get the value for the column at the given index in the query result.
233
- * @param columnIx Index of ECSQL column in query result (0-based)
234
- *
235
- * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
236
- */
237
- getValue(columnIx: number): ECSqlValue;
238
- }
239
- /** Binds a value to an ECSQL parameter.
240
- *
241
- * See also:
242
- *
243
- * - [ECSqlStatement]($backend)
244
- * - [ECSqlStatement.getBinder]($backend)
245
- * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL)
246
- * @public
247
- */
248
- export declare class ECSqlBinder {
249
- private _binder;
250
- /** @internal */
251
- constructor(binder: IModelJsNative.ECSqlBinder);
252
- /** Binds the specified value to the ECSQL parameter.
253
- * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
254
- * iTwin.js types to be used for the different ECSQL parameter types.
255
- * @param val Value to bind
256
- */
257
- bind(val: any): void;
258
- /** Binds null to the ECSQL parameter. */
259
- bindNull(): void;
260
- /** Binds a BLOB value to the ECSQL parameter.
261
- * @param BLOB value as either a UInt8Array, ArrayBuffer or a Base64 string
262
- */
263
- bindBlob(blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
264
- /** Binds a boolean value to the ECSQL parameter.
265
- * @param val Boolean value
266
- */
267
- bindBoolean(val: boolean): void;
268
- /** Binds a DateTime value to the ECSQL parameter.
269
- * @param isoDateTimeString DateTime value as ISO8601 string
270
- */
271
- bindDateTime(isoDateTimeString: string): void;
272
- /** Binds a double value to the ECSQL parameter.
273
- * @param val Double value
274
- */
275
- bindDouble(val: number): void;
276
- /** Binds an GUID value to the ECSQL parameter.
277
- * @param val GUID value. If passed as string, it must be formatted as described in [GuidString]($core-bentley).
278
- */
279
- bindGuid(val: GuidString): void;
280
- /** Binds an Id value to the ECSQL parameter.
281
- * @param val Id value. If passed as string it must be the hexadecimal representation of the Id.
282
- */
283
- bindId(val: Id64String): void;
284
- /** Binds an integer value to the ECSQL parameter.
285
- * @param val Integer value as number, decimal string or hexadecimal string.
286
- */
287
- bindInteger(val: number | string): void;
288
- /** Binds an Point2d value to the ECSQL parameter.
289
- * @param val Point2d value
290
- */
291
- bindPoint2d(val: XAndY): void;
292
- /** Binds an Point3d value to the ECSQL parameter.
293
- * @param val Point3d value
294
- */
295
- bindPoint3d(val: XYAndZ): void;
296
- /** Binds a Range3d as a blob to the ECSQL parameter.
297
- * @param val Range3d value
298
- */
299
- bindRange3d(val: LowAndHighXYZ): void;
300
- /** Binds an string to the ECSQL parameter.
301
- * @param val String value
302
- */
303
- bindString(val: string): void;
304
- /** Binds a navigation property value to the ECSQL parameter.
305
- * @param val Navigation property value
306
- */
307
- bindNavigation(val: NavigationBindingValue): void;
308
- /** Binds a struct property value to the ECSQL parameter.
309
- * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
310
- * (of one of the supported types)
311
- */
312
- bindStruct(val: object): void;
313
- /** Gets the binder for the specified member of a struct parameter
314
- *
315
- * > This is the most low-level way to bind struct parameters with most flexibility. A simpler alternative is
316
- * > to just call [ECSqlBinder.bindStruct]($backend).
317
- */
318
- bindMember(memberName: string): ECSqlBinder;
319
- /** Binds a set of Id strings to the ECSQL parameter.
320
- * @param val array of Id values. If passed as string they must be the hexadecimal representation of the Ids.
321
- */
322
- bindIdSet(vector: Id64String[]): void;
323
- /** Binds an array value to the ECSQL parameter.
324
- * @param val Array value. The array value is an array of values of the supported types
325
- */
326
- bindArray(val: any[]): void;
327
- /** Adds a new array element to the array parameter and returns the binder for the new array element
328
- *
329
- * > This is the most low-level way to bind array parameters with most flexibility. A simpler alternative is
330
- * > to just call [ECSqlBinder.bindArray]($backend).
331
- */
332
- addArrayElement(): ECSqlBinder;
333
- }
334
- /** Represents the value of an ECEnumeration.
335
- *
336
- * See also:
337
- * - [[ECSqlValue.getEnum]]
338
- * - [[ECSqlStatement]]
339
- * - [[ECSqlStatement.getValue]]
340
- * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
341
- * @public
342
- */
343
- export interface ECEnumValue {
344
- schema: string;
345
- name: string;
346
- key: string;
347
- value: number | string;
348
- }
349
- /** Value of a column in a row of an ECSQL query result.
350
- *
351
- * See also:
352
- * - [ECSqlStatement]($backend)
353
- * - [ECSqlStatement.getValue]($backend)
354
- * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
355
- * @public
356
- */
357
- export declare class ECSqlValue {
358
- private _val;
359
- /** @internal */
360
- constructor(val: IModelJsNative.ECSqlValue);
361
- /** Get information about the query result's column this value refers to. */
362
- get columnInfo(): ECSqlColumnInfo;
363
- /** Get the value of this ECSQL value */
364
- get value(): any;
365
- /** Indicates whether the value is NULL or not. */
366
- get isNull(): boolean;
367
- /** Get the value as BLOB */
368
- getBlob(): Uint8Array;
369
- /** Get the value as a boolean value */
370
- getBoolean(): boolean;
371
- /** Get the value as a DateTime value (formatted as ISO8601 string) */
372
- getDateTime(): string;
373
- /** Get the value as a double value */
374
- getDouble(): number;
375
- /** Get the value as a IGeometry value (as ECJSON IGeometry) */
376
- getGeometry(): any;
377
- /** Get the value as a GUID (formatted as GUID string).
378
- * See [GuidString]($core-bentley)
379
- */
380
- getGuid(): GuidString;
381
- /** Get the value as a Id (formatted as hexadecimal string). */
382
- getId(): Id64String;
383
- /** Get the ClassId value formatted as fully qualified class name. */
384
- getClassNameForClassId(): string;
385
- /** Get the value as a integer value */
386
- getInteger(): number;
387
- /** Get the value as a string value */
388
- getString(): string;
389
- /** Get the value as [XAndY]($core-geometry) */
390
- getXAndY(): XAndY;
391
- /** Get the value as [XYAndZ]($core-geometry) */
392
- getXYAndZ(): XYAndZ;
393
- /** Get the value as ECEnumeration value
394
- * Note: This method is optional. Using [[ECSqlValue.getInteger]] for integral enums and
395
- * [[ECSqlValue.getString]] for string enums respectively are the usual way to get
396
- * enum values. This method can be used if the context of the underlying ECEnumeration
397
- * is required.
398
- * The value is broken down into the ECEnumerators that make it up, if the value
399
- * is a combination of ECEnumerators. If the value is not a strict match of an ECEnumerator
400
- * or a combination of them, undefined is returned.
401
- * > Note: You can call [[ECSqlValue.columnInfo.isEnum]] to find out whether
402
- * > this method can be called or not.
403
- * @return ECEnumeration value(s) or undefined if the ECSqlValue does not represent an ECEnumeration.
404
- * or is not a strict match of an ECEnumerator or a combination of them.
405
- */
406
- getEnum(): ECEnumValue[] | undefined;
407
- /** Get the value as [NavigationValue]($common) */
408
- getNavigation(): NavigationValue;
409
- /** Get an iterator for iterating the struct members of this struct value. */
410
- getStructIterator(): ECSqlValueIterator;
411
- /** Get this struct value's content as object literal */
412
- getStruct(): any;
413
- /** Get an iterator for iterating the array elements of this array value. */
414
- getArrayIterator(): ECSqlValueIterator;
415
- /** Get this array value as JavaScript array */
416
- getArray(): any[];
417
- }
418
- /** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).
419
- * See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).
420
- * @public
421
- */
422
- export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
423
- private _it;
424
- /** @internal */
425
- constructor(it: IModelJsNative.ECSqlValueIterator);
426
- next(): IteratorResult<ECSqlValue>;
427
- [Symbol.iterator](): IterableIterator<ECSqlValue>;
428
- }
429
- /** Information about an ECSQL column in an ECSQL query result.
430
- * See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)
431
- * @public
432
- */
433
- export interface ECSqlColumnInfo {
434
- /** Gets the data type of the column.
435
- */
436
- getType(): ECSqlValueType;
437
- /** Gets the name of the property backing the column.
438
- * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
439
- * > the access string consists of the name of the generated property. [[ECSqlColumnInfo.getOriginPropertyName]]
440
- * > can be used to obtain the non-aliased name in that case.
441
- */
442
- getPropertyName(): string;
443
- /** Gets the name of the original property that the column data is from.
444
- * > Other than [[ECSqlColumnInfo.getPropertyName]], this ignores aliases and allows getting the name
445
- * > of the property which is being used for the column. A column may not be backed
446
- * > by a property, in which case this returns undefined.
447
- */
448
- getOriginPropertyName(): string | undefined;
449
- /** Gets the full access string to the corresponding ECSqlValue starting from the root class.
450
- * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
451
- * > the access string consists of the ECSQL expression.
452
- */
453
- getAccessString(): string;
454
- /** Indicates whether the column refers to an ECEnumeration property. */
455
- isEnum(): boolean;
456
- /** Indicates whether the column refers to a system property (e.g. id, className). */
457
- isSystemProperty(): boolean;
458
- /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other
459
- * than simply a reference to an ECProperty, a property is generated containing the expression name.
460
- */
461
- isGeneratedProperty(): boolean;
462
- /** Gets the table space in which this root class is persisted.
463
- * > For classes in the primary file the table space is MAIN. For classes in attached
464
- * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.
465
- */
466
- getRootClassTableSpace(): string;
467
- /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */
468
- getRootClassName(): string;
469
- /** Gets the class alias of the root class to which the column refers to.
470
- * > Returns an empty string if no class alias was specified in the select clause.
471
- */
472
- getRootClassAlias(): string;
473
- }
1
+ /** @packageDocumentation
2
+ * @module ECSQL
3
+ */
4
+ import { DbResult, GuidString, Id64String, IDisposable, StatusCodeWithMessage } from "@itwin/core-bentley";
5
+ import { LowAndHighXYZ, XAndY, XYAndZ } from "@itwin/core-geometry";
6
+ import { ECSqlValueType, NavigationBindingValue, NavigationValue } from "@itwin/core-common";
7
+ import { IModelJsNative } from "@bentley/imodeljs-native";
8
+ /** The result of an **ECSQL INSERT** statement as returned from [ECSqlStatement.stepForInsert]($backend).
9
+ *
10
+ * If the step was successful, the ECSqlInsertResult contains
11
+ * [DbResult.BE_SQLITE_DONE]($core-bentley)
12
+ * and the ECInstanceId of the newly created instance.
13
+ * In case of failure it contains the [DbResult]($core-bentley) error code.
14
+ *
15
+ * > Insert statements can be used with ECDb only, not with IModelDb.
16
+ * @public
17
+ */
18
+ export declare class ECSqlInsertResult {
19
+ status: DbResult;
20
+ id?: string | undefined;
21
+ constructor(status: DbResult, id?: string | undefined);
22
+ }
23
+ /** Executes ECSQL statements.
24
+ *
25
+ * A statement must be prepared before it can be executed, and it must be released when no longer needed.
26
+ * See [IModelDb.withPreparedStatement]($backend) or
27
+ * [ECDb.withPreparedStatement]($backend) for a convenient and
28
+ * reliable way to prepare, execute, and then release a statement.
29
+ *
30
+ * A statement may contain parameters that must be filled in before use by the **bind** methods.
31
+ *
32
+ * Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.step]($backend).
33
+ * In case of an **ECSQL SELECT** statement, the current row can be retrieved with [ECSqlStatement.getRow]($backend) as
34
+ * a whole, or with [ECSqlStatement.getValue]($backend) when individual values are needed.
35
+ * Alternatively, query results of an **ECSQL SELECT** statement can be stepped through by using
36
+ * standard iteration syntax, such as `for of`.
37
+ *
38
+ * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared
39
+ * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.
40
+ * > The key to making this strategy work is to phrase a statement in a general way and use placeholders to represent parameters that will vary on each use.
41
+ *
42
+ * See also
43
+ * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
44
+ * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
45
+ * @public
46
+ */
47
+ export declare class ECSqlStatement implements IterableIterator<any>, IDisposable {
48
+ private _stmt;
49
+ private _sql;
50
+ get sql(): string;
51
+ /** Check if this statement has been prepared successfully or not */
52
+ get isPrepared(): boolean;
53
+ /** Prepare this statement prior to first use.
54
+ * @param db The DgnDb or ECDb to prepare the statement against
55
+ * @param ecsql The ECSQL statement string to prepare
56
+ * @param logErrors Determine if errors are logged or not
57
+ * @throws [IModelError]($common) if the ECSQL statement cannot be prepared. Normally, prepare fails due to ECSQL syntax errors or references to tables or properties that do not exist.
58
+ * The error.message property will provide details.
59
+ * @internal
60
+ */
61
+ prepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): void;
62
+ /** Prepare this statement prior to first use.
63
+ * @param db The DgnDb or ECDb to prepare the statement against
64
+ * @param ecsql The ECSQL statement string to prepare
65
+ * @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()
66
+ * @returns A [StatusCodeWithMessage]($bentley) object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.
67
+ * @internal
68
+ */
69
+ tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): StatusCodeWithMessage<DbResult>;
70
+ /** Reset this statement so that the next call to step will return the first row, if any. */
71
+ reset(): void;
72
+ /** Get the Native SQL statement
73
+ * @internal
74
+ */
75
+ getNativeSql(): string;
76
+ /** Call this function when finished with this statement. This releases the native resources held by the statement.
77
+ *
78
+ * > Do not call this method directly on a statement that is being managed by a statement cache.
79
+ */
80
+ dispose(): void;
81
+ /** Binds the specified value to the specified ECSQL parameter.
82
+ * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
83
+ * iTwin.js types to be used for the different ECSQL parameter types.
84
+ * @param parameter Index (1-based) or name of the parameter
85
+ */
86
+ bindValue(parameter: number | string, val: any): void;
87
+ /** Binds null to the specified ECSQL parameter.
88
+ * @param parameter Index (1-based) or name of the parameter
89
+ */
90
+ bindNull(parameter: number | string): void;
91
+ /** Binds a BLOB value to the specified ECSQL parameter.
92
+ * @param parameter Index (1-based) or name of the parameter
93
+ * @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string
94
+ */
95
+ bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
96
+ /** Binds a boolean value to the specified ECSQL parameter.
97
+ * @param parameter Index (1-based) or name of the parameter
98
+ * @param val Boolean value
99
+ */
100
+ bindBoolean(parameter: number | string, val: boolean): void;
101
+ /** Binds a DateTime value to the specified ECSQL parameter.
102
+ * @param parameter Index (1-based) or name of the parameter
103
+ * @param isoDateTimeString DateTime value as ISO8601 string
104
+ */
105
+ bindDateTime(parameter: number | string, isoDateTimeString: string): void;
106
+ /** Binds a double value to the specified ECSQL parameter.
107
+ * @param parameter Index (1-based) or name of the parameter
108
+ * @param val Double value
109
+ */
110
+ bindDouble(parameter: number | string, val: number): void;
111
+ /** Binds an GUID value to the specified ECSQL parameter.
112
+ * @param parameter Index (1-based) or name of the parameter
113
+ * @param val GUID value
114
+ */
115
+ bindGuid(parameter: number | string, val: GuidString): void;
116
+ /** Binds an Id value to the specified ECSQL parameter.
117
+ * @param parameter Index (1-based) or name of the parameter
118
+ * @param val Id value
119
+ */
120
+ bindId(parameter: number | string, val: Id64String): void;
121
+ /** Binds an integer value to the specified ECSQL parameter.
122
+ * @param parameter Index (1-based) or name of the parameter
123
+ * @param val Integer value as number, decimal string or hexadecimal string.
124
+ */
125
+ bindInteger(parameter: number | string, val: number | string): void;
126
+ /** Binds an Point2d value to the specified ECSQL parameter.
127
+ * @param parameter Index (1-based) or name of the parameter
128
+ * @param val Point2d value
129
+ */
130
+ bindPoint2d(parameter: number | string, val: XAndY): void;
131
+ /** Binds an Point3d value to the specified ECSQL parameter.
132
+ * @param parameter Index (1-based) or name of the parameter
133
+ * @param val Point3d value
134
+ */
135
+ bindPoint3d(parameter: number | string, val: XYAndZ): void;
136
+ /** Binds a Range3d as a blob to the specified ECSQL parameter
137
+ * @param parameter Index(1-based) or name of the parameter
138
+ * @param val Range3d value
139
+ */
140
+ bindRange3d(parameter: number | string, val: LowAndHighXYZ): void;
141
+ /** Binds an string to the specified ECSQL parameter.
142
+ * @param parameter Index (1-based) or name of the parameter
143
+ * @param val String value
144
+ */
145
+ bindString(parameter: number | string, val: string): void;
146
+ /** Binds a navigation property value to the specified ECSQL parameter.
147
+ * @param parameter Index (1-based) or name of the parameter
148
+ * @param val Navigation property value
149
+ */
150
+ bindNavigation(parameter: number | string, val: NavigationBindingValue): void;
151
+ /** Binds a struct property value to the specified ECSQL parameter.
152
+ * @param parameter Index (1-based) or name of the parameter
153
+ * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
154
+ * (of one of the supported types)
155
+ */
156
+ bindStruct(parameter: number | string, val: object): void;
157
+ /** Binds an array value to the specified ECSQL parameter.
158
+ * @param parameter Index (1-based) or name of the parameter
159
+ * @param val Array value. The array value is an array of values of the supported types
160
+ */
161
+ bindArray(parameter: number | string, val: any[]): void;
162
+ bindIdSet(parameter: number | string, val: Id64String[]): void;
163
+ /**
164
+ * Gets a binder to bind a value for an ECSQL parameter
165
+ * > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods
166
+ * > or [ECSqlStatement.bindValues]($backend).
167
+ * @param parameter Index (1-based) or name of the parameter
168
+ */
169
+ getBinder(parameter: string | number): ECSqlBinder;
170
+ /** Bind values to all parameters in the statement.
171
+ * @param values The values to bind to the parameters.
172
+ * Pass an *array* of values if the parameters are *positional*.
173
+ * Pass an *object of the values keyed on the parameter name* for *named parameters*.
174
+ * The values in either the array or object must match the respective types of the parameter.
175
+ *
176
+ * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
177
+ * iTwin.js types to be used for the different ECSQL parameter types.
178
+ *
179
+ * See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)
180
+ */
181
+ bindValues(values: any[] | object): void;
182
+ /** Clear any bindings that were previously set on this statement.
183
+ * @throws [IModelError]($common) in case of errors
184
+ */
185
+ clearBindings(): void;
186
+ /** Step this statement to the next row.
187
+ *
188
+ * For **ECSQL SELECT** statements the method returns
189
+ * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.
190
+ * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.
191
+ * - Error status in case of errors.
192
+ *
193
+ * For **ECSQL INSERT, UPDATE, DELETE** statements the method returns
194
+ * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.
195
+ * - Error status in case of errors.
196
+ *
197
+ * > Insert statements can be used with ECDb only, not with IModelDb.
198
+ *
199
+ * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples)
200
+ */
201
+ step(): DbResult;
202
+ /** @internal added this back in for testing purposes */
203
+ stepAsync(): Promise<DbResult>;
204
+ /** Step this INSERT statement and returns status and the ECInstanceId of the newly
205
+ * created instance.
206
+ *
207
+ * > Insert statements can be used with ECDb only, not with IModelDb.
208
+ *
209
+ * @returns Returns the generated ECInstanceId in case of success and the status of the step
210
+ * call. In case of error, the respective error code is returned.
211
+ */
212
+ stepForInsert(): ECSqlInsertResult;
213
+ /** Get the query result's column count (only for ECSQL SELECT statements). */
214
+ getColumnCount(): number;
215
+ /** Get the current row.
216
+ * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.
217
+ *
218
+ * See also:
219
+ * - [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned row.
220
+ * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
221
+ */
222
+ getRow(): any;
223
+ private static determineResultRowPropertyName;
224
+ /** Calls step when called as an iterator.
225
+ *
226
+ * Each iteration returns an [ECSQL row format]($docs/learning/ECSQLRowFormat) as returned
227
+ * from [ECSqlStatement.getRow]($backend).
228
+ */
229
+ next(): IteratorResult<any>;
230
+ /** The iterator that will step through the results of this statement. */
231
+ [Symbol.iterator](): IterableIterator<any>;
232
+ /** Get the value for the column at the given index in the query result.
233
+ * @param columnIx Index of ECSQL column in query result (0-based)
234
+ *
235
+ * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
236
+ */
237
+ getValue(columnIx: number): ECSqlValue;
238
+ }
239
+ /** Binds a value to an ECSQL parameter.
240
+ *
241
+ * See also:
242
+ *
243
+ * - [ECSqlStatement]($backend)
244
+ * - [ECSqlStatement.getBinder]($backend)
245
+ * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL)
246
+ * @public
247
+ */
248
+ export declare class ECSqlBinder {
249
+ private _binder;
250
+ /** @internal */
251
+ constructor(binder: IModelJsNative.ECSqlBinder);
252
+ /** Binds the specified value to the ECSQL parameter.
253
+ * The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
254
+ * iTwin.js types to be used for the different ECSQL parameter types.
255
+ * @param val Value to bind
256
+ */
257
+ bind(val: any): void;
258
+ /** Binds null to the ECSQL parameter. */
259
+ bindNull(): void;
260
+ /** Binds a BLOB value to the ECSQL parameter.
261
+ * @param BLOB value as either a UInt8Array, ArrayBuffer or a Base64 string
262
+ */
263
+ bindBlob(blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
264
+ /** Binds a boolean value to the ECSQL parameter.
265
+ * @param val Boolean value
266
+ */
267
+ bindBoolean(val: boolean): void;
268
+ /** Binds a DateTime value to the ECSQL parameter.
269
+ * @param isoDateTimeString DateTime value as ISO8601 string
270
+ */
271
+ bindDateTime(isoDateTimeString: string): void;
272
+ /** Binds a double value to the ECSQL parameter.
273
+ * @param val Double value
274
+ */
275
+ bindDouble(val: number): void;
276
+ /** Binds an GUID value to the ECSQL parameter.
277
+ * @param val GUID value. If passed as string, it must be formatted as described in [GuidString]($core-bentley).
278
+ */
279
+ bindGuid(val: GuidString): void;
280
+ /** Binds an Id value to the ECSQL parameter.
281
+ * @param val Id value. If passed as string it must be the hexadecimal representation of the Id.
282
+ */
283
+ bindId(val: Id64String): void;
284
+ /** Binds an integer value to the ECSQL parameter.
285
+ * @param val Integer value as number, decimal string or hexadecimal string.
286
+ */
287
+ bindInteger(val: number | string): void;
288
+ /** Binds an Point2d value to the ECSQL parameter.
289
+ * @param val Point2d value
290
+ */
291
+ bindPoint2d(val: XAndY): void;
292
+ /** Binds an Point3d value to the ECSQL parameter.
293
+ * @param val Point3d value
294
+ */
295
+ bindPoint3d(val: XYAndZ): void;
296
+ /** Binds a Range3d as a blob to the ECSQL parameter.
297
+ * @param val Range3d value
298
+ */
299
+ bindRange3d(val: LowAndHighXYZ): void;
300
+ /** Binds an string to the ECSQL parameter.
301
+ * @param val String value
302
+ */
303
+ bindString(val: string): void;
304
+ /** Binds a navigation property value to the ECSQL parameter.
305
+ * @param val Navigation property value
306
+ */
307
+ bindNavigation(val: NavigationBindingValue): void;
308
+ /** Binds a struct property value to the ECSQL parameter.
309
+ * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
310
+ * (of one of the supported types)
311
+ */
312
+ bindStruct(val: object): void;
313
+ /** Gets the binder for the specified member of a struct parameter
314
+ *
315
+ * > This is the most low-level way to bind struct parameters with most flexibility. A simpler alternative is
316
+ * > to just call [ECSqlBinder.bindStruct]($backend).
317
+ */
318
+ bindMember(memberName: string): ECSqlBinder;
319
+ /** Binds a set of Id strings to the ECSQL parameter.
320
+ * @param val array of Id values. If passed as string they must be the hexadecimal representation of the Ids.
321
+ */
322
+ bindIdSet(vector: Id64String[]): void;
323
+ /** Binds an array value to the ECSQL parameter.
324
+ * @param val Array value. The array value is an array of values of the supported types
325
+ */
326
+ bindArray(val: any[]): void;
327
+ /** Adds a new array element to the array parameter and returns the binder for the new array element
328
+ *
329
+ * > This is the most low-level way to bind array parameters with most flexibility. A simpler alternative is
330
+ * > to just call [ECSqlBinder.bindArray]($backend).
331
+ */
332
+ addArrayElement(): ECSqlBinder;
333
+ }
334
+ /** Represents the value of an ECEnumeration.
335
+ *
336
+ * See also:
337
+ * - [[ECSqlValue.getEnum]]
338
+ * - [[ECSqlStatement]]
339
+ * - [[ECSqlStatement.getValue]]
340
+ * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
341
+ * @public
342
+ */
343
+ export interface ECEnumValue {
344
+ schema: string;
345
+ name: string;
346
+ key: string;
347
+ value: number | string;
348
+ }
349
+ /** Value of a column in a row of an ECSQL query result.
350
+ *
351
+ * See also:
352
+ * - [ECSqlStatement]($backend)
353
+ * - [ECSqlStatement.getValue]($backend)
354
+ * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
355
+ * @public
356
+ */
357
+ export declare class ECSqlValue {
358
+ private _val;
359
+ /** @internal */
360
+ constructor(val: IModelJsNative.ECSqlValue);
361
+ /** Get information about the query result's column this value refers to. */
362
+ get columnInfo(): ECSqlColumnInfo;
363
+ /** Get the value of this ECSQL value */
364
+ get value(): any;
365
+ /** Indicates whether the value is NULL or not. */
366
+ get isNull(): boolean;
367
+ /** Get the value as BLOB */
368
+ getBlob(): Uint8Array;
369
+ /** Get the value as a boolean value */
370
+ getBoolean(): boolean;
371
+ /** Get the value as a DateTime value (formatted as ISO8601 string) */
372
+ getDateTime(): string;
373
+ /** Get the value as a double value */
374
+ getDouble(): number;
375
+ /** Get the value as a IGeometry value (as ECJSON IGeometry) */
376
+ getGeometry(): any;
377
+ /** Get the value as a GUID (formatted as GUID string).
378
+ * See [GuidString]($core-bentley)
379
+ */
380
+ getGuid(): GuidString;
381
+ /** Get the value as a Id (formatted as hexadecimal string). */
382
+ getId(): Id64String;
383
+ /** Get the ClassId value formatted as fully qualified class name. */
384
+ getClassNameForClassId(): string;
385
+ /** Get the value as a integer value */
386
+ getInteger(): number;
387
+ /** Get the value as a string value */
388
+ getString(): string;
389
+ /** Get the value as [XAndY]($core-geometry) */
390
+ getXAndY(): XAndY;
391
+ /** Get the value as [XYAndZ]($core-geometry) */
392
+ getXYAndZ(): XYAndZ;
393
+ /** Get the value as ECEnumeration value
394
+ * Note: This method is optional. Using [[ECSqlValue.getInteger]] for integral enums and
395
+ * [[ECSqlValue.getString]] for string enums respectively are the usual way to get
396
+ * enum values. This method can be used if the context of the underlying ECEnumeration
397
+ * is required.
398
+ * The value is broken down into the ECEnumerators that make it up, if the value
399
+ * is a combination of ECEnumerators. If the value is not a strict match of an ECEnumerator
400
+ * or a combination of them, undefined is returned.
401
+ * > Note: You can call [[ECSqlValue.columnInfo.isEnum]] to find out whether
402
+ * > this method can be called or not.
403
+ * @return ECEnumeration value(s) or undefined if the ECSqlValue does not represent an ECEnumeration.
404
+ * or is not a strict match of an ECEnumerator or a combination of them.
405
+ */
406
+ getEnum(): ECEnumValue[] | undefined;
407
+ /** Get the value as [NavigationValue]($common) */
408
+ getNavigation(): NavigationValue;
409
+ /** Get an iterator for iterating the struct members of this struct value. */
410
+ getStructIterator(): ECSqlValueIterator;
411
+ /** Get this struct value's content as object literal */
412
+ getStruct(): any;
413
+ /** Get an iterator for iterating the array elements of this array value. */
414
+ getArrayIterator(): ECSqlValueIterator;
415
+ /** Get this array value as JavaScript array */
416
+ getArray(): any[];
417
+ }
418
+ /** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).
419
+ * See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).
420
+ * @public
421
+ */
422
+ export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
423
+ private _it;
424
+ /** @internal */
425
+ constructor(it: IModelJsNative.ECSqlValueIterator);
426
+ next(): IteratorResult<ECSqlValue>;
427
+ [Symbol.iterator](): IterableIterator<ECSqlValue>;
428
+ }
429
+ /** Information about an ECSQL column in an ECSQL query result.
430
+ * See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)
431
+ * @public
432
+ */
433
+ export interface ECSqlColumnInfo {
434
+ /** Gets the data type of the column.
435
+ */
436
+ getType(): ECSqlValueType;
437
+ /** Gets the name of the property backing the column.
438
+ * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
439
+ * > the access string consists of the name of the generated property. [[ECSqlColumnInfo.getOriginPropertyName]]
440
+ * > can be used to obtain the non-aliased name in that case.
441
+ */
442
+ getPropertyName(): string;
443
+ /** Gets the name of the original property that the column data is from.
444
+ * > Other than [[ECSqlColumnInfo.getPropertyName]], this ignores aliases and allows getting the name
445
+ * > of the property which is being used for the column. A column may not be backed
446
+ * > by a property, in which case this returns undefined.
447
+ */
448
+ getOriginPropertyName(): string | undefined;
449
+ /** Gets the full access string to the corresponding ECSqlValue starting from the root class.
450
+ * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
451
+ * > the access string consists of the ECSQL expression.
452
+ */
453
+ getAccessString(): string;
454
+ /** Indicates whether the column refers to an ECEnumeration property. */
455
+ isEnum(): boolean;
456
+ /** Indicates whether the column refers to a system property (e.g. id, className). */
457
+ isSystemProperty(): boolean;
458
+ /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other
459
+ * than simply a reference to an ECProperty, a property is generated containing the expression name.
460
+ */
461
+ isGeneratedProperty(): boolean;
462
+ /** Gets the table space in which this root class is persisted.
463
+ * > For classes in the primary file the table space is MAIN. For classes in attached
464
+ * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.
465
+ */
466
+ getRootClassTableSpace(): string;
467
+ /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */
468
+ getRootClassName(): string;
469
+ /** Gets the class alias of the root class to which the column refers to.
470
+ * > Returns an empty string if no class alias was specified in the select clause.
471
+ */
472
+ getRootClassAlias(): string;
473
+ }
474
474
  //# sourceMappingURL=ECSqlStatement.d.ts.map