@itwin/core-backend 5.0.0-dev.97 → 5.0.0-dev.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/BackendHubAccess.d.ts +2 -8
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +12 -5
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +1 -0
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +8 -15
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +23 -54
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +37 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +81 -0
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +181 -2
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +224 -5
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +16 -4
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +40 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +1 -0
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +4 -0
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/HubMock.d.ts +1 -1
- package/lib/cjs/HubMock.d.ts.map +1 -1
- package/lib/cjs/HubMock.js +13 -2
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +4 -0
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +33 -3
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +2 -0
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +2 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +2 -0
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +2 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +3 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +11 -22
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +2 -8
- package/lib/esm/BackendHubAccess.d.ts.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +12 -5
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +1 -0
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/CheckpointManager.d.ts +8 -15
- package/lib/esm/CheckpointManager.d.ts.map +1 -1
- package/lib/esm/CheckpointManager.js +22 -52
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ECDb.d.ts +37 -1
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +82 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +181 -2
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +222 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +16 -4
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +40 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +1 -0
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts.map +1 -1
- package/lib/esm/ElementTreeWalker.js +4 -0
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/HubMock.d.ts +1 -1
- package/lib/esm/HubMock.d.ts.map +1 -1
- package/lib/esm/HubMock.js +13 -2
- package/lib/esm/HubMock.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +4 -0
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +33 -3
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +2 -0
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/ViewStore.d.ts.map +1 -1
- package/lib/esm/ViewStore.js +2 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +2 -0
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +2 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +2 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -0
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js +13 -24
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/test/CloudSqliteMock.d.ts +37 -0
- package/lib/esm/test/CloudSqliteMock.d.ts.map +1 -0
- package/lib/esm/test/CloudSqliteMock.js +117 -0
- package/lib/esm/test/CloudSqliteMock.js.map +1 -0
- package/lib/esm/test/IModelTestUtils.d.ts +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +16 -4
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js +1 -0
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +2 -0
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +12 -1
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +1 -0
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +6 -0
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +253 -163
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js +2 -0
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +1 -0
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +5 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +10 -0
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js +3 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js +18 -7
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js +5 -91
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js +1 -0
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +14 -0
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js +1 -0
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +0 -4
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +1 -0
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.d.ts +2 -0
- package/lib/esm/test/standalone/Drawing.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/Drawing.test.js +120 -0
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -0
- package/lib/esm/test/standalone/IModelWrite.test.js +22 -6
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +1 -0
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +4 -3
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/package.json +13 -12
|
@@ -55,6 +55,8 @@ export interface ECSqlRowArg {
|
|
|
55
55
|
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
56
56
|
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
57
57
|
* @public
|
|
58
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
59
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
58
60
|
*/
|
|
59
61
|
export declare class ECSqlStatement implements IterableIterator<any>, Disposable {
|
|
60
62
|
private _stmt;
|
|
@@ -254,6 +256,179 @@ export declare class ECSqlStatement implements IterableIterator<any>, Disposable
|
|
|
254
256
|
*/
|
|
255
257
|
getValue(columnIx: number): ECSqlValue;
|
|
256
258
|
}
|
|
259
|
+
/** Executes ECSQL INSERT/UPDATE/DELETE statements.
|
|
260
|
+
*
|
|
261
|
+
* A statement must be prepared before it can be executed, and it must be released when no longer needed.
|
|
262
|
+
* See [ECDb.withCachedWriteStatement]($backend) for a convenient and
|
|
263
|
+
* reliable way to prepare, execute, and then release a statement.
|
|
264
|
+
*
|
|
265
|
+
* A statement may contain parameters that must be filled in before use by the **bind** methods.
|
|
266
|
+
*
|
|
267
|
+
* Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.stepForInsert]($backend).
|
|
268
|
+
*
|
|
269
|
+
* > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared
|
|
270
|
+
* > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.
|
|
271
|
+
* > 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.
|
|
272
|
+
*
|
|
273
|
+
* See also
|
|
274
|
+
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
275
|
+
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
export declare class ECSqlWriteStatement {
|
|
279
|
+
private _stmt;
|
|
280
|
+
constructor(stmt?: ECSqlStatement);
|
|
281
|
+
get sql(): string;
|
|
282
|
+
/** Check if this statement has been prepared successfully or not */
|
|
283
|
+
get isPrepared(): boolean;
|
|
284
|
+
/** Get the underlying ECSqlStatement. Needed until we remove ECSqlStatement.
|
|
285
|
+
* @param
|
|
286
|
+
* @internal
|
|
287
|
+
*/
|
|
288
|
+
get stmt(): ECSqlStatement;
|
|
289
|
+
/** Prepare this statement prior to first use.
|
|
290
|
+
* @param db The ECDb to prepare the statement against
|
|
291
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
292
|
+
* @param logErrors Determine if errors are logged or not
|
|
293
|
+
* @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.
|
|
294
|
+
* The error.message property will provide details.
|
|
295
|
+
* @internal
|
|
296
|
+
*/
|
|
297
|
+
prepare(db: IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): void;
|
|
298
|
+
/** Prepare this statement prior to first use.
|
|
299
|
+
* @param db The DgnDb or ECDb to prepare the statement against
|
|
300
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
301
|
+
* @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()
|
|
302
|
+
* @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): {
|
|
306
|
+
status: DbResult;
|
|
307
|
+
message: string;
|
|
308
|
+
};
|
|
309
|
+
/** Reset this statement so that the next call to step will return the first row, if any. */
|
|
310
|
+
reset(): void;
|
|
311
|
+
/** Get the Native SQL statement
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
getNativeSql(): string;
|
|
315
|
+
/** Binds the specified value to the specified ECSQL parameter.
|
|
316
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
317
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
318
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
319
|
+
*/
|
|
320
|
+
bindValue(parameter: number | string, val: any): void;
|
|
321
|
+
/** Binds null to the specified ECSQL parameter.
|
|
322
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
323
|
+
*/
|
|
324
|
+
bindNull(parameter: number | string): void;
|
|
325
|
+
/** Binds a BLOB value to the specified ECSQL parameter.
|
|
326
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
327
|
+
* @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string
|
|
328
|
+
*/
|
|
329
|
+
bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
|
|
330
|
+
/** Binds a boolean value to the specified ECSQL parameter.
|
|
331
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
332
|
+
* @param val Boolean value
|
|
333
|
+
*/
|
|
334
|
+
bindBoolean(parameter: number | string, val: boolean): void;
|
|
335
|
+
/** Binds a DateTime value to the specified ECSQL parameter.
|
|
336
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
337
|
+
* @param isoDateTimeString DateTime value as ISO8601 string
|
|
338
|
+
*/
|
|
339
|
+
bindDateTime(parameter: number | string, isoDateTimeString: string): void;
|
|
340
|
+
/** Binds a double value to the specified ECSQL parameter.
|
|
341
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
342
|
+
* @param val Double value
|
|
343
|
+
*/
|
|
344
|
+
bindDouble(parameter: number | string, val: number): void;
|
|
345
|
+
/** Binds an GUID value to the specified ECSQL parameter.
|
|
346
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
347
|
+
* @param val GUID value
|
|
348
|
+
*/
|
|
349
|
+
bindGuid(parameter: number | string, val: GuidString): void;
|
|
350
|
+
/** Binds an Id value to the specified ECSQL parameter.
|
|
351
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
352
|
+
* @param val Id value
|
|
353
|
+
*/
|
|
354
|
+
bindId(parameter: number | string, val: Id64String): void;
|
|
355
|
+
/** Binds an integer value to the specified ECSQL parameter.
|
|
356
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
357
|
+
* @param val Integer value as number, decimal string or hexadecimal string.
|
|
358
|
+
*/
|
|
359
|
+
bindInteger(parameter: number | string, val: number | string): void;
|
|
360
|
+
/** Binds an Point2d value to the specified ECSQL parameter.
|
|
361
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
362
|
+
* @param val Point2d value
|
|
363
|
+
*/
|
|
364
|
+
bindPoint2d(parameter: number | string, val: XAndY): void;
|
|
365
|
+
/** Binds an Point3d value to the specified ECSQL parameter.
|
|
366
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
367
|
+
* @param val Point3d value
|
|
368
|
+
*/
|
|
369
|
+
bindPoint3d(parameter: number | string, val: XYAndZ): void;
|
|
370
|
+
/** Binds a Range3d as a blob to the specified ECSQL parameter
|
|
371
|
+
* @param parameter Index(1-based) or name of the parameter
|
|
372
|
+
* @param val Range3d value
|
|
373
|
+
*/
|
|
374
|
+
bindRange3d(parameter: number | string, val: LowAndHighXYZ): void;
|
|
375
|
+
/** Binds an string to the specified ECSQL parameter.
|
|
376
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
377
|
+
* @param val String value
|
|
378
|
+
*/
|
|
379
|
+
bindString(parameter: number | string, val: string): void;
|
|
380
|
+
/** Binds a navigation property value to the specified ECSQL parameter.
|
|
381
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
382
|
+
* @param val Navigation property value
|
|
383
|
+
*/
|
|
384
|
+
bindNavigation(parameter: number | string, val: NavigationBindingValue): void;
|
|
385
|
+
/** Binds a struct property value to the specified ECSQL parameter.
|
|
386
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
387
|
+
* @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
|
|
388
|
+
* (of one of the supported types)
|
|
389
|
+
*/
|
|
390
|
+
bindStruct(parameter: number | string, val: object): void;
|
|
391
|
+
/** Binds an array value to the specified ECSQL parameter.
|
|
392
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
393
|
+
* @param val Array value. The array value is an array of values of the supported types
|
|
394
|
+
*/
|
|
395
|
+
bindArray(parameter: number | string, val: any[]): void;
|
|
396
|
+
bindIdSet(parameter: number | string, val: Id64String[]): void;
|
|
397
|
+
/**
|
|
398
|
+
* Gets a binder to bind a value for an ECSQL parameter
|
|
399
|
+
* > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods
|
|
400
|
+
* > or [ECSqlStatement.bindValues]($backend).
|
|
401
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
402
|
+
*/
|
|
403
|
+
getBinder(parameter: string | number): ECSqlBinder;
|
|
404
|
+
/** Bind values to all parameters in the statement.
|
|
405
|
+
* @param values The values to bind to the parameters.
|
|
406
|
+
* Pass an *array* of values if the parameters are *positional*.
|
|
407
|
+
* Pass an *object of the values keyed on the parameter name* for *named parameters*.
|
|
408
|
+
* The values in either the array or object must match the respective types of the parameter.
|
|
409
|
+
*
|
|
410
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
411
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
412
|
+
*
|
|
413
|
+
* See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)
|
|
414
|
+
*/
|
|
415
|
+
bindValues(values: any[] | object): void;
|
|
416
|
+
/** Clear any bindings that were previously set on this statement.
|
|
417
|
+
* @throws [IModelError]($common) in case of errors
|
|
418
|
+
*/
|
|
419
|
+
clearBindings(): void;
|
|
420
|
+
/** Step this INSERT statement and returns status and the ECInstanceId of the newly
|
|
421
|
+
* created instance.
|
|
422
|
+
*
|
|
423
|
+
* > Insert statements can be used with ECDb only, not with IModelDb.
|
|
424
|
+
*
|
|
425
|
+
* @returns Returns the generated ECInstanceId in case of success and the status of the step
|
|
426
|
+
* call. In case of error, the respective error code is returned.
|
|
427
|
+
*/
|
|
428
|
+
stepForInsert(): ECSqlInsertResult;
|
|
429
|
+
/** Get the query result's column count (only for ECSQL SELECT statements). */
|
|
430
|
+
getColumnCount(): number;
|
|
431
|
+
}
|
|
257
432
|
/** Binds a value to an ECSQL parameter.
|
|
258
433
|
*
|
|
259
434
|
* See also:
|
|
@@ -357,6 +532,7 @@ export declare class ECSqlBinder {
|
|
|
357
532
|
* - [[ECSqlStatement.getValue]]
|
|
358
533
|
* - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
359
534
|
* @public
|
|
535
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
360
536
|
*/
|
|
361
537
|
export interface ECEnumValue {
|
|
362
538
|
schema: string;
|
|
@@ -371,7 +547,8 @@ export interface ECEnumValue {
|
|
|
371
547
|
* - [ECSqlStatement.getValue]($backend)
|
|
372
548
|
* - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
373
549
|
* @public
|
|
374
|
-
|
|
550
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
551
|
+
*/
|
|
375
552
|
export declare class ECSqlValue {
|
|
376
553
|
private _val;
|
|
377
554
|
/** @internal */
|
|
@@ -436,7 +613,8 @@ export declare class ECSqlValue {
|
|
|
436
613
|
/** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).
|
|
437
614
|
* See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).
|
|
438
615
|
* @public
|
|
439
|
-
|
|
616
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
617
|
+
*/
|
|
440
618
|
export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
|
|
441
619
|
private _it;
|
|
442
620
|
/** @internal */
|
|
@@ -447,6 +625,7 @@ export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue>
|
|
|
447
625
|
/** Information about an ECSQL column in an ECSQL query result.
|
|
448
626
|
* See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)
|
|
449
627
|
* @public
|
|
628
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
450
629
|
*/
|
|
451
630
|
export interface ECSqlColumnInfo {
|
|
452
631
|
/** Gets the data type of the column.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlStatement.d.ts","sourceRoot":"","sources":["../../src/ECSqlStatement.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAW,KAAK,EAAE,MAAM,EAAO,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAa,cAAc,EAAe,sBAAsB,EAAE,eAAe,EAAuB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1J,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IACF,MAAM,EAAE,QAAQ;IAAS,EAAE,CAAC,EAAE,UAAU;gBAAxC,MAAM,EAAE,QAAQ,EAAS,EAAE,CAAC,EAAE,UA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AAO,CAAC;IAElB,qFAAqF;IACrF,gBAAgB,IAAI,OAAO,CAAC;IAE5B;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC;IAE/B;;;OAGG;IACH,sBAAsB,IAAI,MAAM,CAAC;IAEjC,oGAAoG;IACpG,gBAAgB,IAAI,MAAM,CAAC;IAE3B;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC;CAC7B"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module ECSQL
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ECSqlValueIterator = exports.ECSqlValue = exports.ECSqlBinder = exports.ECSqlStatement = exports.ECSqlInsertResult = void 0;
|
|
10
|
+
exports.ECSqlValueIterator = exports.ECSqlValue = exports.ECSqlBinder = exports.ECSqlWriteStatement = exports.ECSqlStatement = exports.ECSqlInsertResult = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
13
13
|
const core_common_1 = require("@itwin/core-common");
|
|
@@ -54,6 +54,8 @@ exports.ECSqlInsertResult = ECSqlInsertResult;
|
|
|
54
54
|
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
55
55
|
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
56
56
|
* @public
|
|
57
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
58
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
57
59
|
*/
|
|
58
60
|
class ECSqlStatement {
|
|
59
61
|
_stmt;
|
|
@@ -362,12 +364,211 @@ class ECSqlStatement {
|
|
|
362
364
|
*
|
|
363
365
|
* See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
364
366
|
*/
|
|
367
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
365
368
|
getValue(columnIx) {
|
|
366
369
|
(0, core_bentley_1.assert)(undefined !== this._stmt);
|
|
370
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
367
371
|
return new ECSqlValue(this._stmt.getValue(columnIx));
|
|
368
372
|
}
|
|
369
373
|
}
|
|
370
374
|
exports.ECSqlStatement = ECSqlStatement;
|
|
375
|
+
/** Executes ECSQL INSERT/UPDATE/DELETE statements.
|
|
376
|
+
*
|
|
377
|
+
* A statement must be prepared before it can be executed, and it must be released when no longer needed.
|
|
378
|
+
* See [ECDb.withCachedWriteStatement]($backend) for a convenient and
|
|
379
|
+
* reliable way to prepare, execute, and then release a statement.
|
|
380
|
+
*
|
|
381
|
+
* A statement may contain parameters that must be filled in before use by the **bind** methods.
|
|
382
|
+
*
|
|
383
|
+
* Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.stepForInsert]($backend).
|
|
384
|
+
*
|
|
385
|
+
* > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared
|
|
386
|
+
* > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.
|
|
387
|
+
* > 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.
|
|
388
|
+
*
|
|
389
|
+
* See also
|
|
390
|
+
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
391
|
+
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
392
|
+
* @public
|
|
393
|
+
*/
|
|
394
|
+
class ECSqlWriteStatement {
|
|
395
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
396
|
+
_stmt;
|
|
397
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
398
|
+
constructor(stmt) {
|
|
399
|
+
if (stmt)
|
|
400
|
+
this._stmt = stmt;
|
|
401
|
+
else {
|
|
402
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
403
|
+
this._stmt = new ECSqlStatement();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
get sql() { return this._stmt.sql; }
|
|
407
|
+
/** Check if this statement has been prepared successfully or not */
|
|
408
|
+
get isPrepared() { return this._stmt.isPrepared; }
|
|
409
|
+
/** Get the underlying ECSqlStatement. Needed until we remove ECSqlStatement.
|
|
410
|
+
* @param
|
|
411
|
+
* @internal
|
|
412
|
+
*/
|
|
413
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
414
|
+
get stmt() { return this._stmt; }
|
|
415
|
+
/** Prepare this statement prior to first use.
|
|
416
|
+
* @param db The ECDb to prepare the statement against
|
|
417
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
418
|
+
* @param logErrors Determine if errors are logged or not
|
|
419
|
+
* @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.
|
|
420
|
+
* The error.message property will provide details.
|
|
421
|
+
* @internal
|
|
422
|
+
*/
|
|
423
|
+
prepare(db, ecsql, logErrors = true) {
|
|
424
|
+
this._stmt.prepare(db, ecsql, logErrors);
|
|
425
|
+
}
|
|
426
|
+
/** Prepare this statement prior to first use.
|
|
427
|
+
* @param db The DgnDb or ECDb to prepare the statement against
|
|
428
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
429
|
+
* @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()
|
|
430
|
+
* @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.
|
|
431
|
+
* @internal
|
|
432
|
+
*/
|
|
433
|
+
tryPrepare(db, ecsql, logErrors = false) {
|
|
434
|
+
return this.tryPrepare(db, ecsql, logErrors);
|
|
435
|
+
}
|
|
436
|
+
/** Reset this statement so that the next call to step will return the first row, if any. */
|
|
437
|
+
reset() {
|
|
438
|
+
this._stmt.reset();
|
|
439
|
+
}
|
|
440
|
+
/** Get the Native SQL statement
|
|
441
|
+
* @internal
|
|
442
|
+
*/
|
|
443
|
+
getNativeSql() {
|
|
444
|
+
return this._stmt.getNativeSql();
|
|
445
|
+
}
|
|
446
|
+
/** Binds the specified value to the specified ECSQL parameter.
|
|
447
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
448
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
449
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
450
|
+
*/
|
|
451
|
+
bindValue(parameter, val) { this.getBinder(parameter).bind(val); }
|
|
452
|
+
/** Binds null to the specified ECSQL parameter.
|
|
453
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
454
|
+
*/
|
|
455
|
+
bindNull(parameter) { this.getBinder(parameter).bindNull(); }
|
|
456
|
+
/** Binds a BLOB value to the specified ECSQL parameter.
|
|
457
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
458
|
+
* @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string
|
|
459
|
+
*/
|
|
460
|
+
bindBlob(parameter, blob) { this.getBinder(parameter).bindBlob(blob); }
|
|
461
|
+
/** Binds a boolean value to the specified ECSQL parameter.
|
|
462
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
463
|
+
* @param val Boolean value
|
|
464
|
+
*/
|
|
465
|
+
bindBoolean(parameter, val) { this.getBinder(parameter).bindBoolean(val); }
|
|
466
|
+
/** Binds a DateTime value to the specified ECSQL parameter.
|
|
467
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
468
|
+
* @param isoDateTimeString DateTime value as ISO8601 string
|
|
469
|
+
*/
|
|
470
|
+
bindDateTime(parameter, isoDateTimeString) { this.getBinder(parameter).bindDateTime(isoDateTimeString); }
|
|
471
|
+
/** Binds a double value to the specified ECSQL parameter.
|
|
472
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
473
|
+
* @param val Double value
|
|
474
|
+
*/
|
|
475
|
+
bindDouble(parameter, val) { this.getBinder(parameter).bindDouble(val); }
|
|
476
|
+
/** Binds an GUID value to the specified ECSQL parameter.
|
|
477
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
478
|
+
* @param val GUID value
|
|
479
|
+
*/
|
|
480
|
+
bindGuid(parameter, val) { this.getBinder(parameter).bindGuid(val); }
|
|
481
|
+
/** Binds an Id value to the specified ECSQL parameter.
|
|
482
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
483
|
+
* @param val Id value
|
|
484
|
+
*/
|
|
485
|
+
bindId(parameter, val) { this.getBinder(parameter).bindId(val); }
|
|
486
|
+
/** Binds an integer value to the specified ECSQL parameter.
|
|
487
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
488
|
+
* @param val Integer value as number, decimal string or hexadecimal string.
|
|
489
|
+
*/
|
|
490
|
+
bindInteger(parameter, val) { this.getBinder(parameter).bindInteger(val); }
|
|
491
|
+
/** Binds an Point2d value to the specified ECSQL parameter.
|
|
492
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
493
|
+
* @param val Point2d value
|
|
494
|
+
*/
|
|
495
|
+
bindPoint2d(parameter, val) { this.getBinder(parameter).bindPoint2d(val); }
|
|
496
|
+
/** Binds an Point3d value to the specified ECSQL parameter.
|
|
497
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
498
|
+
* @param val Point3d value
|
|
499
|
+
*/
|
|
500
|
+
bindPoint3d(parameter, val) { this.getBinder(parameter).bindPoint3d(val); }
|
|
501
|
+
/** Binds a Range3d as a blob to the specified ECSQL parameter
|
|
502
|
+
* @param parameter Index(1-based) or name of the parameter
|
|
503
|
+
* @param val Range3d value
|
|
504
|
+
*/
|
|
505
|
+
bindRange3d(parameter, val) { this.getBinder(parameter).bindRange3d(val); }
|
|
506
|
+
/** Binds an string to the specified ECSQL parameter.
|
|
507
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
508
|
+
* @param val String value
|
|
509
|
+
*/
|
|
510
|
+
bindString(parameter, val) { this.getBinder(parameter).bindString(val); }
|
|
511
|
+
/** Binds a navigation property value to the specified ECSQL parameter.
|
|
512
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
513
|
+
* @param val Navigation property value
|
|
514
|
+
*/
|
|
515
|
+
bindNavigation(parameter, val) { this.getBinder(parameter).bindNavigation(val); }
|
|
516
|
+
/** Binds a struct property value to the specified ECSQL parameter.
|
|
517
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
518
|
+
* @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
|
|
519
|
+
* (of one of the supported types)
|
|
520
|
+
*/
|
|
521
|
+
bindStruct(parameter, val) { this.getBinder(parameter).bindStruct(val); }
|
|
522
|
+
/** Binds an array value to the specified ECSQL parameter.
|
|
523
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
524
|
+
* @param val Array value. The array value is an array of values of the supported types
|
|
525
|
+
*/
|
|
526
|
+
bindArray(parameter, val) { this.getBinder(parameter).bindArray(val); }
|
|
527
|
+
bindIdSet(parameter, val) { this.getBinder(parameter).bindIdSet(val); }
|
|
528
|
+
/**
|
|
529
|
+
* Gets a binder to bind a value for an ECSQL parameter
|
|
530
|
+
* > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods
|
|
531
|
+
* > or [ECSqlStatement.bindValues]($backend).
|
|
532
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
533
|
+
*/
|
|
534
|
+
getBinder(parameter) {
|
|
535
|
+
return this._stmt.getBinder(parameter);
|
|
536
|
+
}
|
|
537
|
+
/** Bind values to all parameters in the statement.
|
|
538
|
+
* @param values The values to bind to the parameters.
|
|
539
|
+
* Pass an *array* of values if the parameters are *positional*.
|
|
540
|
+
* Pass an *object of the values keyed on the parameter name* for *named parameters*.
|
|
541
|
+
* The values in either the array or object must match the respective types of the parameter.
|
|
542
|
+
*
|
|
543
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
544
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
545
|
+
*
|
|
546
|
+
* See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)
|
|
547
|
+
*/
|
|
548
|
+
bindValues(values) {
|
|
549
|
+
this._stmt.bindValues(values);
|
|
550
|
+
}
|
|
551
|
+
/** Clear any bindings that were previously set on this statement.
|
|
552
|
+
* @throws [IModelError]($common) in case of errors
|
|
553
|
+
*/
|
|
554
|
+
clearBindings() {
|
|
555
|
+
this._stmt.clearBindings();
|
|
556
|
+
}
|
|
557
|
+
/** Step this INSERT statement and returns status and the ECInstanceId of the newly
|
|
558
|
+
* created instance.
|
|
559
|
+
*
|
|
560
|
+
* > Insert statements can be used with ECDb only, not with IModelDb.
|
|
561
|
+
*
|
|
562
|
+
* @returns Returns the generated ECInstanceId in case of success and the status of the step
|
|
563
|
+
* call. In case of error, the respective error code is returned.
|
|
564
|
+
*/
|
|
565
|
+
stepForInsert() {
|
|
566
|
+
return this._stmt.stepForInsert();
|
|
567
|
+
}
|
|
568
|
+
/** Get the query result's column count (only for ECSQL SELECT statements). */
|
|
569
|
+
getColumnCount() { return this._stmt.getColumnCount(); }
|
|
570
|
+
}
|
|
571
|
+
exports.ECSqlWriteStatement = ECSqlWriteStatement;
|
|
371
572
|
/** Binds a value to an ECSQL parameter.
|
|
372
573
|
*
|
|
373
574
|
* See also:
|
|
@@ -529,12 +730,14 @@ exports.ECSqlBinder = ECSqlBinder;
|
|
|
529
730
|
* - [ECSqlStatement.getValue]($backend)
|
|
530
731
|
* - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
531
732
|
* @public
|
|
532
|
-
|
|
733
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
734
|
+
*/
|
|
533
735
|
class ECSqlValue {
|
|
534
736
|
_val;
|
|
535
737
|
/** @internal */
|
|
536
738
|
constructor(val) { this._val = val; }
|
|
537
739
|
/** Get information about the query result's column this value refers to. */
|
|
740
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
538
741
|
get columnInfo() { return this._val.getColumnInfo(); }
|
|
539
742
|
/** Get the value of this ECSQL value */
|
|
540
743
|
get value() { return ECSqlValueHelper.getValue(this); }
|
|
@@ -579,14 +782,17 @@ class ECSqlValue {
|
|
|
579
782
|
* @return ECEnumeration value(s) or undefined if the ECSqlValue does not represent an ECEnumeration.
|
|
580
783
|
* or is not a strict match of an ECEnumerator or a combination of them.
|
|
581
784
|
*/
|
|
785
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
582
786
|
getEnum() { return this._val.getEnum(); }
|
|
583
787
|
/** Get the value as [NavigationValue]($common) */
|
|
584
788
|
getNavigation() { return this._val.getNavigation(); }
|
|
585
789
|
/** Get an iterator for iterating the struct members of this struct value. */
|
|
790
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
586
791
|
getStructIterator() { return new ECSqlValueIterator(this._val.getStructIterator()); }
|
|
587
792
|
/** Get this struct value's content as object literal */
|
|
588
793
|
getStruct() { return ECSqlValueHelper.getStruct(this); }
|
|
589
794
|
/** Get an iterator for iterating the array elements of this array value. */
|
|
795
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
590
796
|
getArrayIterator() { return new ECSqlValueIterator(this._val.getArrayIterator()); }
|
|
591
797
|
/** Get this array value as JavaScript array */
|
|
592
798
|
getArray() { return ECSqlValueHelper.getArray(this); }
|
|
@@ -595,16 +801,21 @@ exports.ECSqlValue = ECSqlValue;
|
|
|
595
801
|
/** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).
|
|
596
802
|
* See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).
|
|
597
803
|
* @public
|
|
598
|
-
|
|
804
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) instead.
|
|
805
|
+
*/
|
|
599
806
|
class ECSqlValueIterator {
|
|
600
807
|
_it;
|
|
601
808
|
/** @internal */
|
|
602
809
|
constructor(it) { this._it = it; }
|
|
810
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
603
811
|
next() {
|
|
604
|
-
if (this._it.moveNext())
|
|
812
|
+
if (this._it.moveNext()) {
|
|
813
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
605
814
|
return { done: false, value: new ECSqlValue(this._it.getCurrent()) };
|
|
815
|
+
}
|
|
606
816
|
return { done: true, value: undefined };
|
|
607
817
|
}
|
|
818
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
608
819
|
[Symbol.iterator]() { return this; }
|
|
609
820
|
}
|
|
610
821
|
exports.ECSqlValueIterator = ECSqlValueIterator;
|
|
@@ -715,6 +926,7 @@ class ECSqlBindingHelper {
|
|
|
715
926
|
}
|
|
716
927
|
}
|
|
717
928
|
class ECSqlValueHelper {
|
|
929
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
718
930
|
static getValue(ecsqlValue) {
|
|
719
931
|
if (ecsqlValue.isNull)
|
|
720
932
|
return undefined;
|
|
@@ -731,6 +943,7 @@ class ECSqlValueHelper {
|
|
|
731
943
|
return ECSqlValueHelper.getPrimitiveValue(ecsqlValue);
|
|
732
944
|
}
|
|
733
945
|
}
|
|
946
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
734
947
|
static getStruct(ecsqlValue) {
|
|
735
948
|
if (ecsqlValue.isNull)
|
|
736
949
|
return undefined;
|
|
@@ -749,6 +962,7 @@ class ECSqlValueHelper {
|
|
|
749
962
|
}
|
|
750
963
|
return structVal;
|
|
751
964
|
}
|
|
965
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
752
966
|
static getArray(ecsqlValue) {
|
|
753
967
|
const arrayVal = [];
|
|
754
968
|
const it = ecsqlValue.getArrayIterator();
|
|
@@ -762,9 +976,11 @@ class ECSqlValueHelper {
|
|
|
762
976
|
}
|
|
763
977
|
return arrayVal;
|
|
764
978
|
}
|
|
979
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
765
980
|
static getPrimitiveValue(ecsqlValue) {
|
|
766
981
|
if (ecsqlValue.isNull)
|
|
767
982
|
return undefined;
|
|
983
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
768
984
|
const colInfo = ecsqlValue.columnInfo;
|
|
769
985
|
switch (colInfo.getType()) {
|
|
770
986
|
case core_common_1.ECSqlValueType.Blob:
|
|
@@ -800,7 +1016,10 @@ class ECSqlValueHelper {
|
|
|
800
1016
|
static queryClassName(ecdb, classId, tableSpace) {
|
|
801
1017
|
if (!tableSpace)
|
|
802
1018
|
tableSpace = "main";
|
|
803
|
-
|
|
1019
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1020
|
+
return ecdb.withPreparedStatement(`SELECT s.Name, c.Name FROM [${tableSpace}].meta.ECSchemaDef s, JOIN [${tableSpace}].meta.ECClassDef c ON s.ECInstanceId=c.SchemaId WHERE c.ECInstanceId=?`,
|
|
1021
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1022
|
+
(stmt) => {
|
|
804
1023
|
stmt.bindId(1, classId);
|
|
805
1024
|
if (stmt.step() !== core_bentley_1.DbResult.BE_SQLITE_ROW)
|
|
806
1025
|
throw new core_common_1.IModelError(core_bentley_1.DbResult.BE_SQLITE_ERROR, `No class found with ECClassId ${classId} in table space ${tableSpace}.`);
|