@itwin/core-backend 3.4.0-dev.56 → 3.4.0-dev.58

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 (227) 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.js +41 -41
  6. package/lib/cjs/BackendHubAccess.js.map +1 -1
  7. package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
  8. package/lib/cjs/BackendLoggerCategory.js +99 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BisCoreSchema.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.d.ts +165 -165
  14. package/lib/cjs/BriefcaseManager.js +405 -405
  15. package/lib/cjs/BriefcaseManager.js.map +1 -1
  16. package/lib/cjs/Category.d.ts +153 -153
  17. package/lib/cjs/Category.js +243 -243
  18. package/lib/cjs/Category.js.map +1 -1
  19. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  20. package/lib/cjs/ChangeSummaryManager.js +445 -445
  21. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  22. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  23. package/lib/cjs/ChangedElementsDb.js +165 -165
  24. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  25. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  26. package/lib/cjs/ChangedElementsManager.js +88 -88
  27. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  28. package/lib/cjs/CheckpointManager.d.ts +120 -120
  29. package/lib/cjs/CheckpointManager.js +343 -343
  30. package/lib/cjs/CheckpointManager.js.map +1 -1
  31. package/lib/cjs/ClassRegistry.d.ts +71 -71
  32. package/lib/cjs/ClassRegistry.js +215 -215
  33. package/lib/cjs/ClassRegistry.js.map +1 -1
  34. package/lib/cjs/CloudSqlite.d.ts +349 -328
  35. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  36. package/lib/cjs/CloudSqlite.js +151 -135
  37. package/lib/cjs/CloudSqlite.js.map +1 -1
  38. package/lib/cjs/CloudStorageBackend.d.ts +58 -58
  39. package/lib/cjs/CloudStorageBackend.js +173 -173
  40. package/lib/cjs/CloudStorageBackend.js.map +1 -1
  41. package/lib/cjs/CodeService.d.ts +396 -391
  42. package/lib/cjs/CodeService.d.ts.map +1 -1
  43. package/lib/cjs/CodeService.js +63 -63
  44. package/lib/cjs/CodeService.js.map +1 -1
  45. package/lib/cjs/CodeSpecs.d.ts +50 -50
  46. package/lib/cjs/CodeSpecs.js +112 -112
  47. package/lib/cjs/CodeSpecs.js.map +1 -1
  48. package/lib/cjs/ConcurrentQuery.d.ts +11 -11
  49. package/lib/cjs/ConcurrentQuery.js +30 -30
  50. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  51. package/lib/cjs/CustomViewState3dCreator.d.ts +32 -32
  52. package/lib/cjs/CustomViewState3dCreator.js +113 -113
  53. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  54. package/lib/cjs/DevTools.d.ts +71 -71
  55. package/lib/cjs/DevTools.js +154 -154
  56. package/lib/cjs/DevTools.js.map +1 -1
  57. package/lib/cjs/DisplayStyle.d.ts +106 -106
  58. package/lib/cjs/DisplayStyle.js +256 -256
  59. package/lib/cjs/DisplayStyle.js.map +1 -1
  60. package/lib/cjs/ECDb.d.ts +191 -191
  61. package/lib/cjs/ECDb.js +350 -350
  62. package/lib/cjs/ECDb.js.map +1 -1
  63. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  64. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  65. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  66. package/lib/cjs/ECSqlStatement.d.ts +466 -466
  67. package/lib/cjs/ECSqlStatement.js +791 -791
  68. package/lib/cjs/ECSqlStatement.js.map +1 -1
  69. package/lib/cjs/Element.d.ts +1109 -1109
  70. package/lib/cjs/Element.js +1420 -1420
  71. package/lib/cjs/Element.js.map +1 -1
  72. package/lib/cjs/ElementAspect.d.ts +156 -156
  73. package/lib/cjs/ElementAspect.js +178 -178
  74. package/lib/cjs/ElementAspect.js.map +1 -1
  75. package/lib/cjs/ElementGraphics.d.ts +9 -9
  76. package/lib/cjs/ElementGraphics.js +41 -41
  77. package/lib/cjs/ElementGraphics.js.map +1 -1
  78. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  79. package/lib/cjs/ElementTreeWalker.js +409 -409
  80. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  81. package/lib/cjs/Entity.d.ts +76 -76
  82. package/lib/cjs/Entity.js +82 -82
  83. package/lib/cjs/Entity.js.map +1 -1
  84. package/lib/cjs/ExportGraphics.d.ts +317 -317
  85. package/lib/cjs/ExportGraphics.js +208 -208
  86. package/lib/cjs/ExportGraphics.js.map +1 -1
  87. package/lib/cjs/ExternalSource.d.ts +94 -94
  88. package/lib/cjs/ExternalSource.js +125 -125
  89. package/lib/cjs/ExternalSource.js.map +1 -1
  90. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  91. package/lib/cjs/GeoCoordConfig.js +82 -82
  92. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  93. package/lib/cjs/GeometrySummary.d.ts +4 -4
  94. package/lib/cjs/GeometrySummary.js +380 -380
  95. package/lib/cjs/GeometrySummary.js.map +1 -1
  96. package/lib/cjs/HubMock.d.ts +93 -93
  97. package/lib/cjs/HubMock.js +190 -190
  98. package/lib/cjs/HubMock.js.map +1 -1
  99. package/lib/cjs/IModelCloneContext.d.ts +85 -85
  100. package/lib/cjs/IModelCloneContext.js +150 -150
  101. package/lib/cjs/IModelCloneContext.js.map +1 -1
  102. package/lib/cjs/IModelDb.d.ts +1164 -1164
  103. package/lib/cjs/IModelDb.js +2324 -2324
  104. package/lib/cjs/IModelDb.js.map +1 -1
  105. package/lib/cjs/IModelHost.d.ts +361 -361
  106. package/lib/cjs/IModelHost.js +489 -489
  107. package/lib/cjs/IModelHost.js.map +1 -1
  108. package/lib/cjs/IModelJsFs.d.ts +62 -62
  109. package/lib/cjs/IModelJsFs.d.ts.map +1 -1
  110. package/lib/cjs/IModelJsFs.js +140 -140
  111. package/lib/cjs/IModelJsFs.js.map +1 -1
  112. package/lib/cjs/IpcHost.d.ts +98 -98
  113. package/lib/cjs/IpcHost.js +234 -234
  114. package/lib/cjs/IpcHost.js.map +1 -1
  115. package/lib/cjs/LineStyle.d.ts +311 -311
  116. package/lib/cjs/LineStyle.js +295 -295
  117. package/lib/cjs/LineStyle.js.map +1 -1
  118. package/lib/cjs/LocalHub.d.ts +162 -162
  119. package/lib/cjs/LocalHub.js +587 -587
  120. package/lib/cjs/LocalHub.js.map +1 -1
  121. package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
  122. package/lib/cjs/LocalhostIpcHost.js +81 -81
  123. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  124. package/lib/cjs/Material.d.ts +103 -103
  125. package/lib/cjs/Material.js +147 -147
  126. package/lib/cjs/Material.js.map +1 -1
  127. package/lib/cjs/Model.d.ts +386 -386
  128. package/lib/cjs/Model.js +471 -471
  129. package/lib/cjs/Model.js.map +1 -1
  130. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  131. package/lib/cjs/NativeAppStorage.js +202 -202
  132. package/lib/cjs/NativeAppStorage.js.map +1 -1
  133. package/lib/cjs/NativeHost.d.ts +52 -52
  134. package/lib/cjs/NativeHost.js +168 -168
  135. package/lib/cjs/NativeHost.js.map +1 -1
  136. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  137. package/lib/cjs/NavigationRelationship.js +225 -225
  138. package/lib/cjs/NavigationRelationship.js.map +1 -1
  139. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  140. package/lib/cjs/PromiseMemoizer.js +101 -101
  141. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  142. package/lib/cjs/PropertyStore.d.ts +132 -132
  143. package/lib/cjs/PropertyStore.d.ts.map +1 -1
  144. package/lib/cjs/PropertyStore.js +11 -11
  145. package/lib/cjs/PropertyStore.js.map +1 -1
  146. package/lib/cjs/Relationship.d.ts +400 -400
  147. package/lib/cjs/Relationship.js +465 -465
  148. package/lib/cjs/Relationship.js.map +1 -1
  149. package/lib/cjs/RpcBackend.d.ts +28 -28
  150. package/lib/cjs/RpcBackend.js +126 -126
  151. package/lib/cjs/RpcBackend.js.map +1 -1
  152. package/lib/cjs/SQLiteDb.d.ts +219 -219
  153. package/lib/cjs/SQLiteDb.js +214 -214
  154. package/lib/cjs/SQLiteDb.js.map +1 -1
  155. package/lib/cjs/Schema.d.ts +55 -55
  156. package/lib/cjs/Schema.js +83 -83
  157. package/lib/cjs/Schema.js.map +1 -1
  158. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  159. package/lib/cjs/ServerBasedLocks.js +168 -168
  160. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  161. package/lib/cjs/SqliteStatement.d.ts +283 -283
  162. package/lib/cjs/SqliteStatement.js +448 -448
  163. package/lib/cjs/SqliteStatement.js.map +1 -1
  164. package/lib/cjs/Texture.d.ts +58 -58
  165. package/lib/cjs/Texture.js +82 -82
  166. package/lib/cjs/Texture.js.map +1 -1
  167. package/lib/cjs/TileStorage.d.ts +18 -18
  168. package/lib/cjs/TileStorage.d.ts.map +1 -1
  169. package/lib/cjs/TileStorage.js +90 -90
  170. package/lib/cjs/TileStorage.js.map +1 -1
  171. package/lib/cjs/TxnManager.d.ts +202 -202
  172. package/lib/cjs/TxnManager.js +356 -356
  173. package/lib/cjs/TxnManager.js.map +1 -1
  174. package/lib/cjs/ViewDefinition.d.ts +435 -435
  175. package/lib/cjs/ViewDefinition.js +635 -635
  176. package/lib/cjs/ViewDefinition.js.map +1 -1
  177. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  178. package/lib/cjs/ViewStateHydrator.js +103 -103
  179. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  180. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  181. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
  182. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  183. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  184. package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
  185. package/lib/cjs/core-backend.d.ts +182 -182
  186. package/lib/cjs/core-backend.js +202 -202
  187. package/lib/cjs/core-backend.js.map +1 -1
  188. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  189. package/lib/cjs/domains/FunctionalElements.js +145 -145
  190. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  191. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  192. package/lib/cjs/domains/FunctionalSchema.js +40 -40
  193. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  194. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  195. package/lib/cjs/domains/GenericElements.js +263 -263
  196. package/lib/cjs/domains/GenericElements.js.map +1 -1
  197. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  198. package/lib/cjs/domains/GenericSchema.js +28 -28
  199. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  200. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  201. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  202. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  203. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +45 -45
  204. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +262 -262
  205. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  206. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
  207. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +204 -204
  208. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  209. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  210. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
  211. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  212. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  213. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
  214. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  215. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  216. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  217. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  218. package/lib/cjs/workspace/Settings.d.ts +186 -186
  219. package/lib/cjs/workspace/Settings.js +155 -155
  220. package/lib/cjs/workspace/Settings.js.map +1 -1
  221. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  222. package/lib/cjs/workspace/SettingsSchemas.js +191 -191
  223. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  224. package/lib/cjs/workspace/Workspace.d.ts +414 -414
  225. package/lib/cjs/workspace/Workspace.js +543 -543
  226. package/lib/cjs/workspace/Workspace.js.map +1 -1
  227. package/package.json +14 -14
@@ -1,467 +1,467 @@
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.
440
- */
441
- getPropertyName(): string;
442
- /** Gets the full access string to the corresponding ECSqlValue starting from the root class.
443
- * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
444
- * > the access string consists of the ECSQL expression.
445
- */
446
- getAccessString(): string;
447
- /** Indicates whether the column refers to an ECEnumeration property. */
448
- isEnum(): boolean;
449
- /** Indicates whether the column refers to a system property (e.g. id, className). */
450
- isSystemProperty(): boolean;
451
- /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other
452
- * than simply a reference to an ECProperty, a property is generated containing the expression name.
453
- */
454
- isGeneratedProperty(): boolean;
455
- /** Gets the table space in which this root class is persisted.
456
- * > For classes in the primary file the table space is MAIN. For classes in attached
457
- * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.
458
- */
459
- getRootClassTableSpace(): string;
460
- /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */
461
- getRootClassName(): string;
462
- /** Gets the class alias of the root class to which the column refers to.
463
- * > Returns an empty string if no class alias was specified in the select clause.
464
- */
465
- getRootClassAlias(): string;
466
- }
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.
440
+ */
441
+ getPropertyName(): string;
442
+ /** Gets the full access string to the corresponding ECSqlValue starting from the root class.
443
+ * > If this column is backed by a generated property, i.e. it represents ECSQL expression,
444
+ * > the access string consists of the ECSQL expression.
445
+ */
446
+ getAccessString(): string;
447
+ /** Indicates whether the column refers to an ECEnumeration property. */
448
+ isEnum(): boolean;
449
+ /** Indicates whether the column refers to a system property (e.g. id, className). */
450
+ isSystemProperty(): boolean;
451
+ /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other
452
+ * than simply a reference to an ECProperty, a property is generated containing the expression name.
453
+ */
454
+ isGeneratedProperty(): boolean;
455
+ /** Gets the table space in which this root class is persisted.
456
+ * > For classes in the primary file the table space is MAIN. For classes in attached
457
+ * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.
458
+ */
459
+ getRootClassTableSpace(): string;
460
+ /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */
461
+ getRootClassName(): string;
462
+ /** Gets the class alias of the root class to which the column refers to.
463
+ * > Returns an empty string if no class alias was specified in the select clause.
464
+ */
465
+ getRootClassAlias(): string;
466
+ }
467
467
  //# sourceMappingURL=ECSqlStatement.d.ts.map