@itwin/core-backend 4.11.0-dev.2 → 4.11.0-dev.4

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 (53) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  3. package/lib/cjs/BisCoreSchema.js +2 -0
  4. package/lib/cjs/BisCoreSchema.js.map +1 -1
  5. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  6. package/lib/cjs/ChangeSummaryManager.js +12 -5
  7. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  8. package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
  9. package/lib/cjs/ChangesetECAdaptor.js +1 -0
  10. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  11. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  12. package/lib/cjs/CheckpointManager.js +2 -0
  13. package/lib/cjs/CheckpointManager.js.map +1 -1
  14. package/lib/cjs/ECDb.d.ts +46 -1
  15. package/lib/cjs/ECDb.d.ts.map +1 -1
  16. package/lib/cjs/ECDb.js +90 -0
  17. package/lib/cjs/ECDb.js.map +1 -1
  18. package/lib/cjs/ECSqlStatement.d.ts +200 -2
  19. package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
  20. package/lib/cjs/ECSqlStatement.js +237 -5
  21. package/lib/cjs/ECSqlStatement.js.map +1 -1
  22. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  23. package/lib/cjs/ElementAspect.js +2 -0
  24. package/lib/cjs/ElementAspect.js.map +1 -1
  25. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  26. package/lib/cjs/ElementTreeWalker.js +4 -0
  27. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  28. package/lib/cjs/IModelDb.d.ts +13 -1
  29. package/lib/cjs/IModelDb.d.ts.map +1 -1
  30. package/lib/cjs/IModelDb.js +41 -5
  31. package/lib/cjs/IModelDb.js.map +1 -1
  32. package/lib/cjs/IModelHost.d.ts.map +1 -1
  33. package/lib/cjs/IModelHost.js +1 -1
  34. package/lib/cjs/IModelHost.js.map +1 -1
  35. package/lib/cjs/Relationship.d.ts.map +1 -1
  36. package/lib/cjs/Relationship.js +3 -1
  37. package/lib/cjs/Relationship.js.map +1 -1
  38. package/lib/cjs/ViewStore.d.ts.map +1 -1
  39. package/lib/cjs/ViewStore.js +2 -1
  40. package/lib/cjs/ViewStore.js.map +1 -1
  41. package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
  42. package/lib/cjs/internal/ChannelAdmin.js +2 -0
  43. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  44. package/lib/cjs/rpc/multipart.d.ts.map +1 -1
  45. package/lib/cjs/rpc/multipart.js +2 -1
  46. package/lib/cjs/rpc/multipart.js.map +1 -1
  47. package/lib/cjs/rpc/web/request.d.ts.map +1 -1
  48. package/lib/cjs/rpc/web/request.js +2 -1
  49. package/lib/cjs/rpc/web/request.js.map +1 -1
  50. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  51. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +3 -2
  52. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  53. package/package.json +18 -15
@@ -1 +1 @@
1
- {"version":3,"file":"ECSqlStatement.js","sourceRoot":"","sources":["../../src/ECSqlStatement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4F;AAC5F,wDAAkF;AAClF,oDAA0J;AAG1J,8DAAyD;AAEzD;;;;;;;;;GASG;AACH,MAAa,iBAAiB;IAC5B,YAA0B,MAAgB,EAAS,EAAe;QAAxC,WAAM,GAAN,MAAM,CAAU;QAAS,OAAE,GAAF,EAAE,CAAa;IAAI,CAAC;CACxE;AAFD,8CAEC;AAeD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,cAAc;IAA3B;QAGU,WAAM,GAAG,IAAI,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AC,SAAS,EAAE,EAAE,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAED,MAAM,eAAe;IACZ,MAAM,CAAC,MAAM,CAAC,GAAQ,IAAuB,OAAO,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC;IAEhF,MAAM,CAAC,OAAO,CAAC,GAAQ,IAAkB,OAAO,mBAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,CAAC,QAAQ,CAAC,GAAQ,IAAmB,OAAO,mBAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,CAAC,eAAe,CAAC,GAAQ,IAA0B,OAAO,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7L,MAAM,CAAC,wBAAwB,CAAC,GAAQ,IAAmC,OAAO,GAAG,CAAC,EAAE,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;CACjJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ECSQL\n */\n\nimport { assert, DbResult, GuidString, Id64String, IDisposable } from \"@itwin/core-bentley\";\nimport { LowAndHighXYZ, Range3d, XAndY, XYAndZ, XYZ } from \"@itwin/core-geometry\";\nimport { ECJsNames, ECSqlValueType, IModelError, NavigationBindingValue, NavigationValue, PropertyMetaDataMap, QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { ECDb } from \"./ECDb\";\nimport { IModelNative } from \"./internal/NativePlatform\";\n\n/** The result of an **ECSQL INSERT** statement as returned from [ECSqlStatement.stepForInsert]($backend).\n *\n * If the step was successful, the ECSqlInsertResult contains\n * [DbResult.BE_SQLITE_DONE]($core-bentley)\n * and the ECInstanceId of the newly created instance.\n * In case of failure it contains the [DbResult]($core-bentley) error code.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n * @public\n */\nexport class ECSqlInsertResult {\n public constructor(public status: DbResult, public id?: Id64String) { }\n}\n\n/**\n * Arguments supplied to [[ECSqlStatement.getRow]].\n * @public\n * */\nexport interface ECSqlRowArg {\n /** Determine row format. */\n rowFormat?: QueryRowFormat;\n /**\n * Determine if classIds are converted to class names.\n */\n classIdsToClassNames?: boolean;\n}\n\n/** Executes ECSQL statements.\n *\n * A statement must be prepared before it can be executed, and it must be released when no longer needed.\n * See [IModelDb.withPreparedStatement]($backend) or\n * [ECDb.withPreparedStatement]($backend) for a convenient and\n * reliable way to prepare, execute, and then release a statement.\n *\n * A statement may contain parameters that must be filled in before use by the **bind** methods.\n *\n * Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.step]($backend).\n * In case of an **ECSQL SELECT** statement, the current row can be retrieved with [ECSqlStatement.getRow]($backend) as\n * a whole, or with [ECSqlStatement.getValue]($backend) when individual values are needed.\n * Alternatively, query results of an **ECSQL SELECT** statement can be stepped through by using\n * standard iteration syntax, such as `for of`.\n *\n * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared\n * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.\n * > 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.\n *\n * See also\n * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL\n * @public\n */\nexport class ECSqlStatement implements IterableIterator<any>, IDisposable {\n private _stmt: IModelJsNative.ECSqlStatement | undefined;\n private _sql: string | undefined;\n private _props = new PropertyMetaDataMap([]);\n\n public get sql() { return this._sql!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** Check if this statement has been prepared successfully or not */\n public get isPrepared(): boolean { return !!this._stmt; }\n\n /** Prepare this statement prior to first use.\n * @param db The DgnDb or ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not\n * @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.\n * The error.message property will provide details.\n * @internal\n */\n public prepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors = true): void {\n const stat = this.tryPrepare(db, ecsql, logErrors);\n if (stat.status !== DbResult.BE_SQLITE_OK) {\n throw new IModelError(stat.status, stat.message);\n }\n }\n\n /** Prepare this statement prior to first use.\n * @param db The DgnDb or ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()\n * @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.\n * @internal\n */\n public tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors = false): { status: DbResult, message: string } {\n if (this.isPrepared)\n throw new Error(\"ECSqlStatement is already prepared\");\n this._sql = ecsql;\n this._stmt = new IModelNative.platform.ECSqlStatement();\n return this._stmt.prepare(db, ecsql, logErrors);\n }\n\n /** Reset this statement so that the next call to step will return the first row, if any. */\n public reset(): void {\n assert(undefined !== this._stmt);\n this._stmt.reset();\n this._props = new PropertyMetaDataMap([]);\n }\n\n /** Get the Native SQL statement\n * @internal\n */\n public getNativeSql(): string {\n assert(undefined !== this._stmt);\n return this._stmt.getNativeSql();\n }\n\n /** Call this function when finished with this statement. This releases the native resources held by the statement.\n *\n * > Do not call this method directly on a statement that is being managed by a statement cache.\n */\n public dispose(): void {\n if (this._stmt) {\n this._stmt.dispose(); // free native statement\n this._stmt = undefined;\n }\n }\n\n /** Binds the specified value to the specified ECSQL parameter.\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindValue(parameter: number | string, val: any): void { this.getBinder(parameter).bind(val); }\n\n /** Binds null to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindNull(parameter: number | string): void { this.getBinder(parameter).bindNull(); }\n\n /** Binds a BLOB value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string\n */\n public bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void { this.getBinder(parameter).bindBlob(blob); }\n\n /** Binds a boolean value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Boolean value\n */\n public bindBoolean(parameter: number | string, val: boolean): void { this.getBinder(parameter).bindBoolean(val); }\n\n /** Binds a DateTime value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param isoDateTimeString DateTime value as ISO8601 string\n */\n public bindDateTime(parameter: number | string, isoDateTimeString: string): void { this.getBinder(parameter).bindDateTime(isoDateTimeString); }\n\n /** Binds a double value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Double value\n */\n public bindDouble(parameter: number | string, val: number): void { this.getBinder(parameter).bindDouble(val); }\n\n /** Binds an GUID value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val GUID value\n */\n public bindGuid(parameter: number | string, val: GuidString): void { this.getBinder(parameter).bindGuid(val); }\n\n /** Binds an Id value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Id value\n */\n public bindId(parameter: number | string, val: Id64String): void { this.getBinder(parameter).bindId(val); }\n\n /** Binds an integer value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Integer value as number, decimal string or hexadecimal string.\n */\n public bindInteger(parameter: number | string, val: number | string): void { this.getBinder(parameter).bindInteger(val); }\n\n /** Binds an Point2d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point2d value\n */\n public bindPoint2d(parameter: number | string, val: XAndY): void { this.getBinder(parameter).bindPoint2d(val); }\n\n /** Binds an Point3d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point3d value\n */\n public bindPoint3d(parameter: number | string, val: XYAndZ): void { this.getBinder(parameter).bindPoint3d(val); }\n\n /** Binds a Range3d as a blob to the specified ECSQL parameter\n * @param parameter Index(1-based) or name of the parameter\n * @param val Range3d value\n */\n public bindRange3d(parameter: number | string, val: LowAndHighXYZ): void { this.getBinder(parameter).bindRange3d(val); }\n\n /** Binds an string to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val String value\n */\n public bindString(parameter: number | string, val: string): void { this.getBinder(parameter).bindString(val); }\n\n /** Binds a navigation property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Navigation property value\n */\n public bindNavigation(parameter: number | string, val: NavigationBindingValue): void { this.getBinder(parameter).bindNavigation(val); }\n\n /** Binds a struct property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value\n * (of one of the supported types)\n */\n public bindStruct(parameter: number | string, val: object): void { this.getBinder(parameter).bindStruct(val); }\n\n /** Binds an array value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Array value. The array value is an array of values of the supported types\n */\n public bindArray(parameter: number | string, val: any[]): void { this.getBinder(parameter).bindArray(val); }\n\n public bindIdSet(parameter: number | string, val: Id64String[]): void { this.getBinder(parameter).bindIdSet(val); }\n /**\n * Gets a binder to bind a value for an ECSQL parameter\n * > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods\n * > or [ECSqlStatement.bindValues]($backend).\n * @param parameter Index (1-based) or name of the parameter\n */\n public getBinder(parameter: string | number): ECSqlBinder {\n assert(undefined !== this._stmt);\n return new ECSqlBinder(this._stmt.getBinder(parameter));\n }\n\n /** Bind values to all parameters in the statement.\n * @param values The values to bind to the parameters.\n * Pass an *array* of values if the parameters are *positional*.\n * Pass an *object of the values keyed on the parameter name* for *named parameters*.\n * The values in either the array or object must match the respective types of the parameter.\n *\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n *\n * See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)\n */\n public bindValues(values: any[] | object): void {\n if (Array.isArray(values)) {\n for (let i = 0; i < values.length; i++) {\n const paramIndex: number = i + 1;\n const paramValue: any = values[i];\n if (paramValue === undefined || paramValue === null)\n continue;\n\n this.bindValue(paramIndex, paramValue);\n }\n return;\n }\n\n for (const entry of Object.entries(values)) {\n const paramName: string = entry[0];\n const paramValue: any = entry[1];\n if (paramValue === undefined || paramValue === null)\n continue;\n\n this.bindValue(paramName, paramValue);\n }\n }\n\n /** Clear any bindings that were previously set on this statement.\n * @throws [IModelError]($common) in case of errors\n */\n public clearBindings(): void {\n if (this._stmt) {\n const stat: DbResult = this._stmt.clearBindings();\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error clearing bindings\");\n }\n }\n\n /** Step this statement to the next row.\n *\n * For **ECSQL SELECT** statements the method returns\n * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.\n * - Error status in case of errors.\n *\n * For **ECSQL INSERT, UPDATE, DELETE** statements the method returns\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.\n * - Error status in case of errors.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n *\n * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples)\n */\n public step(): DbResult { return this._stmt!.step(); } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** @internal added this back in for testing purposes */\n public async stepAsync(): Promise<DbResult> {\n return new Promise((resolve, _reject) => {\n this._stmt!.stepAsync(resolve); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n });\n }\n\n /** Step this INSERT statement and returns status and the ECInstanceId of the newly\n * created instance.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n *\n * @returns Returns the generated ECInstanceId in case of success and the status of the step\n * call. In case of error, the respective error code is returned.\n */\n public stepForInsert(): ECSqlInsertResult {\n assert(undefined !== this._stmt);\n const r: { status: DbResult, id: string } = this._stmt.stepForInsert();\n if (r.status === DbResult.BE_SQLITE_DONE)\n return new ECSqlInsertResult(r.status, r.id);\n\n return new ECSqlInsertResult(r.status);\n }\n\n /** Get the query result's column count (only for ECSQL SELECT statements). */\n public getColumnCount(): number { return this._stmt!.getColumnCount(); } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** Get the current row.\n * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.\n *\n * See also:\n * - [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned row.\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n */\n public getRow(args?: ECSqlRowArg): any {\n if (!this._stmt)\n throw new Error(\"ECSqlStatement is not prepared\");\n\n args = args ?? {};\n if (args.rowFormat === undefined) {\n args.rowFormat = QueryRowFormat.UseJsPropertyNames;\n }\n const resp = this._stmt.toRow({\n classIdsToClassNames: args.classIdsToClassNames,\n useJsName: args.rowFormat === QueryRowFormat.UseJsPropertyNames,\n abbreviateBlobs: false,\n // In 4.x, people are currently dependent on the behavior of aliased classIds `select classId as aliasedClassId` not being\n // converted into classNames which is a bug that we must now support.This option preserves this special behavior until\n // it can be removed in a future version.\n doNotConvertClassIdsToClassNamesWhenAliased: true,\n });\n return this.formatCurrentRow(resp, args.rowFormat);\n }\n\n private formatCurrentRow(currentResp: any, rowFormat: QueryRowFormat = QueryRowFormat.UseJsPropertyNames): any[] | object {\n if (!this._stmt)\n throw new Error(\"ECSqlStatement is not prepared\");\n\n if (rowFormat === QueryRowFormat.UseECSqlPropertyIndexes)\n return currentResp.data;\n\n if (this._props.length === 0) {\n const resp = this._stmt.getMetadata();\n this._props = new PropertyMetaDataMap(resp.meta);\n }\n const formattedRow = {};\n for (const prop of this._props) {\n const propName = rowFormat === QueryRowFormat.UseJsPropertyNames ? prop.jsonName : prop.name;\n const val = currentResp.data[prop.index];\n if (typeof val !== \"undefined\" && val !== null) {\n Object.defineProperty(formattedRow, propName, {\n value: val,\n enumerable: true,\n writable: true,\n });\n }\n }\n return formattedRow;\n }\n\n /** Calls step when called as an iterator.\n *\n * Each iteration returns an [ECSQL row format]($docs/learning/ECSQLRowFormat) as returned\n * from [ECSqlStatement.getRow]($backend).\n */\n public next(): IteratorResult<any> {\n if (DbResult.BE_SQLITE_ROW === this.step()) {\n return {\n done: false,\n value: this.getRow(),\n };\n } else {\n return {\n done: true,\n value: undefined,\n };\n }\n }\n\n /** The iterator that will step through the results of this statement. */\n public [Symbol.iterator](): IterableIterator<any> { return this; }\n\n /** Get the value for the column at the given index in the query result.\n * @param columnIx Index of ECSQL column in query result (0-based)\n *\n * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n */\n public getValue(columnIx: number): ECSqlValue {\n assert(undefined !== this._stmt);\n return new ECSqlValue(this._stmt.getValue(columnIx));\n }\n}\n\n/** Binds a value to an ECSQL parameter.\n *\n * See also:\n *\n * - [ECSqlStatement]($backend)\n * - [ECSqlStatement.getBinder]($backend)\n * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL)\n * @public\n */\nexport class ECSqlBinder {\n private _binder: IModelJsNative.ECSqlBinder;\n\n /** @internal */\n public constructor(binder: IModelJsNative.ECSqlBinder) { this._binder = binder; }\n\n /** Binds the specified value to the ECSQL parameter.\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n * @param val Value to bind\n */\n public bind(val: any): void {\n ECSqlBindingHelper.bindValue(this, val);\n }\n\n /** Binds null to the ECSQL parameter. */\n public bindNull(): void {\n const stat: DbResult = this._binder.bindNull();\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding null\");\n }\n\n /** Binds a BLOB value to the ECSQL parameter.\n * @param BLOB value as either a UInt8Array, ArrayBuffer or a Base64 string\n */\n public bindBlob(blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void {\n const stat: DbResult = this._binder.bindBlob(blob);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding blob\");\n }\n\n /** Binds a boolean value to the ECSQL parameter.\n * @param val Boolean value\n */\n public bindBoolean(val: boolean): void {\n const stat: DbResult = this._binder.bindBoolean(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding boolean\");\n }\n\n /** Binds a DateTime value to the ECSQL parameter.\n * @param isoDateTimeString DateTime value as ISO8601 string\n */\n public bindDateTime(isoDateTimeString: string): void {\n const stat: DbResult = this._binder.bindDateTime(isoDateTimeString);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding DateTime\");\n }\n\n /** Binds a double value to the ECSQL parameter.\n * @param val Double value\n */\n public bindDouble(val: number): void {\n const stat: DbResult = this._binder.bindDouble(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding double\");\n }\n\n /** Binds an GUID value to the ECSQL parameter.\n * @param val GUID value. If passed as string, it must be formatted as described in [GuidString]($core-bentley).\n */\n public bindGuid(val: GuidString): void {\n const stat: DbResult = this._binder.bindGuid(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding GUID\");\n }\n\n /** Binds an Id value to the ECSQL parameter.\n * @param val Id value. If passed as string it must be the hexadecimal representation of the Id.\n */\n public bindId(val: Id64String): void {\n const stat: DbResult = this._binder.bindId(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Id\");\n }\n\n /** Binds an integer value to the ECSQL parameter.\n * @param val Integer value as number, decimal string or hexadecimal string.\n */\n public bindInteger(val: number | string): void {\n const stat: DbResult = this._binder.bindInteger(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding integer\");\n }\n\n /** Binds an Point2d value to the ECSQL parameter.\n * @param val Point2d value\n */\n public bindPoint2d(val: XAndY): void {\n const stat: DbResult = this._binder.bindPoint2d(val.x, val.y);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Point2d\");\n }\n\n /** Binds an Point3d value to the ECSQL parameter.\n * @param val Point3d value\n */\n public bindPoint3d(val: XYAndZ): void {\n const stat: DbResult = this._binder.bindPoint3d(val.x, val.y, val.z);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Point3d\");\n }\n\n /** Binds a Range3d as a blob to the ECSQL parameter.\n * @param val Range3d value\n */\n public bindRange3d(val: LowAndHighXYZ): void {\n const stat: DbResult = this._binder.bindBlob(Range3d.toFloat64Array(val).buffer);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Range3d\");\n }\n\n /** Binds an string to the ECSQL parameter.\n * @param val String value\n */\n public bindString(val: string): void {\n const stat: DbResult = this._binder.bindString(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding string\");\n }\n\n /** Binds a navigation property value to the ECSQL parameter.\n * @param val Navigation property value\n */\n public bindNavigation(val: NavigationBindingValue): void {\n const stat: DbResult = this._binder.bindNavigation(val.id, val.relClassName, val.relClassTableSpace);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding navigation property\");\n }\n\n /** Binds a struct property value to the ECSQL parameter.\n * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value\n * (of one of the supported types)\n */\n public bindStruct(val: object): void { ECSqlBindingHelper.bindStruct(this, val); }\n\n /** Gets the binder for the specified member of a struct parameter\n *\n * > This is the most low-level way to bind struct parameters with most flexibility. A simpler alternative is\n * > to just call [ECSqlBinder.bindStruct]($backend).\n */\n public bindMember(memberName: string): ECSqlBinder { return new ECSqlBinder(this._binder.bindMember(memberName)); }\n\n /** Binds a set of Id strings to the ECSQL parameter.\n * @param val array of Id values. If passed as string they must be the hexadecimal representation of the Ids.\n */\n public bindIdSet(vector: Id64String[]): void {\n const stat: DbResult = this._binder.bindIdSet(vector);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding id set\");\n }\n\n /** Binds an array value to the ECSQL parameter.\n * @param val Array value. The array value is an array of values of the supported types\n */\n public bindArray(val: any[]): void { ECSqlBindingHelper.bindArray(this, val); }\n\n /** Adds a new array element to the array parameter and returns the binder for the new array element\n *\n * > This is the most low-level way to bind array parameters with most flexibility. A simpler alternative is\n * > to just call [ECSqlBinder.bindArray]($backend).\n */\n public addArrayElement(): ECSqlBinder { return new ECSqlBinder(this._binder.addArrayElement()); }\n}\n\n/** Represents the value of an ECEnumeration.\n *\n * See also:\n * - [[ECSqlValue.getEnum]]\n * - [[ECSqlStatement]]\n * - [[ECSqlStatement.getValue]]\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n * @public\n */\nexport interface ECEnumValue {\n schema: string;\n name: string;\n key: string;\n value: number | string;\n}\n\n/** Value of a column in a row of an ECSQL query result.\n *\n * See also:\n * - [ECSqlStatement]($backend)\n * - [ECSqlStatement.getValue]($backend)\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n * @public\n */\nexport class ECSqlValue {\n private _val: IModelJsNative.ECSqlValue;\n\n /** @internal */\n public constructor(val: IModelJsNative.ECSqlValue) { this._val = val; }\n\n /** Get information about the query result's column this value refers to. */\n public get columnInfo(): ECSqlColumnInfo { return this._val.getColumnInfo() as ECSqlColumnInfo; }\n\n /** Get the value of this ECSQL value */\n public get value(): any { return ECSqlValueHelper.getValue(this); }\n\n /** Indicates whether the value is NULL or not. */\n public get isNull(): boolean { return this._val.isNull(); }\n /** Get the value as BLOB */\n public getBlob(): Uint8Array { return this._val.getBlob(); }\n /** Get the value as a boolean value */\n public getBoolean(): boolean { return this._val.getBoolean(); }\n /** Get the value as a DateTime value (formatted as ISO8601 string) */\n public getDateTime(): string { return this._val.getDateTime(); }\n /** Get the value as a double value */\n public getDouble(): number { return this._val.getDouble(); }\n /** Get the value as a IGeometry value (as ECJSON IGeometry) */\n public getGeometry(): any { return JSON.parse(this._val.getGeometry()); }\n /** Get the value as a GUID (formatted as GUID string).\n * See [GuidString]($core-bentley)\n */\n public getGuid(): GuidString { return this._val.getGuid(); }\n /** Get the value as a Id (formatted as hexadecimal string). */\n public getId(): Id64String { return this._val.getId(); }\n /** Get the ClassId value formatted as fully qualified class name. */\n public getClassNameForClassId(): string { return this._val.getClassNameForClassId(); }\n /** Get the value as a integer value */\n public getInteger(): number { return this._val.getInt64(); }\n /** Get the value as a string value */\n public getString(): string { return this._val.getString(); }\n /** Get the value as [XAndY]($core-geometry) */\n public getXAndY(): XAndY { return this._val.getPoint2d(); }\n /** Get the value as [XYAndZ]($core-geometry) */\n public getXYAndZ(): XYAndZ { return this._val.getPoint3d(); }\n /** Get the value as ECEnumeration value\n * Note: This method is optional. Using [[ECSqlValue.getInteger]] for integral enums and\n * [[ECSqlValue.getString]] for string enums respectively are the usual way to get\n * enum values. This method can be used if the context of the underlying ECEnumeration\n * is required.\n * The value is broken down into the ECEnumerators that make it up, if the value\n * is a combination of ECEnumerators. If the value is not a strict match of an ECEnumerator\n * or a combination of them, undefined is returned.\n * > Note: You can call [[ECSqlValue.columnInfo.isEnum]] to find out whether\n * > this method can be called or not.\n * @return ECEnumeration value(s) or undefined if the ECSqlValue does not represent an ECEnumeration.\n * or is not a strict match of an ECEnumerator or a combination of them.\n */\n public getEnum(): ECEnumValue[] | undefined { return this._val.getEnum(); }\n\n /** Get the value as [NavigationValue]($common) */\n public getNavigation(): NavigationValue { return this._val.getNavigation(); }\n\n /** Get an iterator for iterating the struct members of this struct value. */\n public getStructIterator(): ECSqlValueIterator { return new ECSqlValueIterator(this._val.getStructIterator()); }\n\n /** Get this struct value's content as object literal */\n public getStruct(): any { return ECSqlValueHelper.getStruct(this); }\n\n /** Get an iterator for iterating the array elements of this array value. */\n public getArrayIterator(): ECSqlValueIterator { return new ECSqlValueIterator(this._val.getArrayIterator()); }\n\n /** Get this array value as JavaScript array */\n public getArray(): any[] { return ECSqlValueHelper.getArray(this); }\n}\n\n/** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).\n * See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).\n * @public\n */\nexport class ECSqlValueIterator implements IterableIterator<ECSqlValue> {\n private _it: IModelJsNative.ECSqlValueIterator;\n\n /** @internal */\n public constructor(it: IModelJsNative.ECSqlValueIterator) { this._it = it; }\n\n public next(): IteratorResult<ECSqlValue> {\n if (this._it.moveNext())\n return { done: false, value: new ECSqlValue(this._it.getCurrent()) };\n\n return { done: true, value: undefined };\n }\n\n public [Symbol.iterator](): IterableIterator<ECSqlValue> { return this; }\n}\n\n/** Information about an ECSQL column in an ECSQL query result.\n * See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)\n * @public\n */\nexport interface ECSqlColumnInfo {\n /** Gets the data type of the column.\n */\n getType(): ECSqlValueType;\n\n /** Gets the name of the property backing the column.\n * > If this column is backed by a generated property, i.e. it represents ECSQL expression,\n * > the access string consists of the name of the generated property. [[ECSqlColumnInfo.getOriginPropertyName]]\n * > can be used to obtain the non-aliased name in that case.\n */\n getPropertyName(): string;\n\n /** Gets the name of the original property that the column data is from.\n * > Other than [[ECSqlColumnInfo.getPropertyName]], this ignores aliases and allows getting the name\n * > of the property which is being used for the column. A column may not be backed\n * > by a property, in which case this returns undefined.\n */\n getOriginPropertyName(): string | undefined;\n\n /** Gets the full access string to the corresponding ECSqlValue starting from the root class.\n * > If this column is backed by a generated property, i.e. it represents ECSQL expression,\n * > the access string consists of the ECSQL expression.\n */\n getAccessString(): string;\n\n /** Indicates whether the column refers to an ECEnumeration property. */\n isEnum(): boolean;\n\n /** Indicates whether the column refers to a system property (e.g. id, className). */\n isSystemProperty(): boolean;\n\n /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other\n * than simply a reference to an ECProperty, a property is generated containing the expression name.\n */\n isGeneratedProperty(): boolean;\n\n /** Gets the table space in which this root class is persisted.\n * > For classes in the primary file the table space is MAIN. For classes in attached\n * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.\n */\n getRootClassTableSpace(): string;\n\n /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */\n getRootClassName(): string;\n\n /** Gets the class alias of the root class to which the column refers to.\n * > Returns an empty string if no class alias was specified in the select clause.\n */\n getRootClassAlias(): string;\n}\n\nclass ECSqlBindingHelper {\n\n /** Binds the specified value to the specified binder\n * @param binder Parameter Binder to bind to\n * @param val Value to be bound. (See [iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes))\n * @throws IModelError in case of errors\n */\n public static bindValue(binder: ECSqlBinder, val: any): void {\n // returns false if val is no primitive and returns true if it is primitive and a binding call was done\n if (ECSqlBindingHelper.tryBindPrimitiveTypes(binder, val))\n return;\n\n if (Array.isArray(val)) {\n ECSqlBindingHelper.bindArray(binder, val);\n return;\n }\n\n if (typeof (val) === \"object\") {\n ECSqlBindingHelper.bindStruct(binder, val);\n return;\n }\n\n throw new Error(`Bound value is of an unsupported type: ${val}`);\n }\n\n /** Binds the specified primitive value to the specified binder\n * @param binder Parameter Binder to bind to\n * @param val Primitive value to be bound. Must be of one of these types described here:\n * [ECSQL Binding types]($docs/learning/ECSQLParameterTypes)\n * @throws IModelError in case of errors\n */\n public static bindPrimitive(binder: ECSqlBinder, val: any): void {\n if (!ECSqlBindingHelper.tryBindPrimitiveTypes(binder, val))\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Binding value is of an unsupported primitive type: ${val}`);\n }\n\n /** Binds the specified object to the specified struct binder\n * @param binder Struct parameter binder to bind to\n * @param val Value to be bound. Must be an Object with members of the supported types\n * @throws IModelError in case of errors\n */\n public static bindStruct(binder: ECSqlBinder, val: object): void {\n if (val === null || val === undefined) {\n binder.bindNull();\n return;\n }\n\n for (const member of Object.entries(val)) {\n const memberName: string = member[0];\n const memberVal: any = member[1];\n ECSqlBindingHelper.bindValue(binder.bindMember(memberName), memberVal);\n }\n }\n\n /** Binds the specified array to the specified array binder\n * @param binder Array parameter binder to bind to\n * @param val Value to be bound. Must be an Array with elements of the supported types\n * @throws IModelError in case of errors\n */\n public static bindArray(binder: ECSqlBinder, val: any[]): void {\n if (val === null || val === undefined) {\n binder.bindNull();\n return;\n }\n\n for (const element of val) {\n ECSqlBindingHelper.bindValue(binder.addArrayElement(), element);\n }\n }\n\n /** tries to interpret the passed value as known leaf types (primitives and navigation values).\n * @returns Returns undefined if the value wasn't a primitive. DbResult if it was a primitive and was bound to the binder\n */\n private static tryBindPrimitiveTypes(binder: ECSqlBinder, val: any): boolean {\n if (val === undefined || val === null) {\n binder.bindNull();\n return true;\n }\n\n if (typeof (val) === \"number\") {\n if (Number.isInteger(val))\n binder.bindInteger(val);\n else\n binder.bindDouble(val);\n\n return true;\n }\n\n if (typeof (val) === \"boolean\") {\n binder.bindBoolean(val);\n return true;\n }\n\n if (typeof (val) === \"string\") {\n binder.bindString(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isBlob(val)) {\n binder.bindBlob(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isXYAndZ(val)) {\n binder.bindPoint3d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isXAndY(val)) {\n binder.bindPoint2d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isLowAndHighXYZ(val)) {\n binder.bindRange3d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isNavigationBindingValue(val)) {\n binder.bindNavigation(val);\n return true;\n }\n\n return false;\n }\n}\n\nclass ECSqlValueHelper {\n public static getValue(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n const dataType: ECSqlValueType = ecsqlValue.columnInfo.getType();\n switch (dataType) {\n case ECSqlValueType.Struct:\n return ECSqlValueHelper.getStruct(ecsqlValue);\n\n case ECSqlValueType.Navigation:\n return ecsqlValue.getNavigation();\n\n case ECSqlValueType.PrimitiveArray:\n case ECSqlValueType.StructArray:\n return ECSqlValueHelper.getArray(ecsqlValue);\n\n default:\n return ECSqlValueHelper.getPrimitiveValue(ecsqlValue);\n }\n }\n\n public static getStruct(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n const structVal = {};\n const it = ecsqlValue.getStructIterator();\n try {\n for (const memberECSqlVal of it) {\n if (memberECSqlVal.isNull)\n continue;\n\n const memberName: string = ECJsNames.toJsName(memberECSqlVal.columnInfo.getPropertyName());\n const memberVal = ECSqlValueHelper.getValue(memberECSqlVal);\n Object.defineProperty(structVal, memberName, { enumerable: true, configurable: true, writable: true, value: memberVal });\n }\n } finally {\n }\n\n return structVal;\n }\n\n public static getArray(ecsqlValue: ECSqlValue): any[] {\n const arrayVal: any[] = [];\n const it = ecsqlValue.getArrayIterator();\n try {\n for (const elementECSqlVal of it) {\n const memberVal = ECSqlValueHelper.getValue(elementECSqlVal);\n arrayVal.push(memberVal);\n }\n } finally {\n }\n return arrayVal;\n }\n\n private static getPrimitiveValue(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n const colInfo: ECSqlColumnInfo = ecsqlValue.columnInfo;\n switch (colInfo.getType()) {\n case ECSqlValueType.Blob:\n return ecsqlValue.getBlob();\n case ECSqlValueType.Boolean:\n return ecsqlValue.getBoolean();\n case ECSqlValueType.DateTime:\n return ecsqlValue.getDateTime();\n case ECSqlValueType.Double:\n return ecsqlValue.getDouble();\n case ECSqlValueType.Geometry:\n return ecsqlValue.getGeometry();\n case ECSqlValueType.Guid:\n return ecsqlValue.getGuid();\n case ECSqlValueType.Id: {\n if (colInfo.isSystemProperty() && colInfo.getPropertyName().endsWith(\"ECClassId\"))\n return ecsqlValue.getClassNameForClassId();\n\n return ecsqlValue.getId();\n }\n case ECSqlValueType.Int:\n case ECSqlValueType.Int64:\n return ecsqlValue.getInteger();\n case ECSqlValueType.Point2d:\n return ecsqlValue.getXAndY();\n case ECSqlValueType.Point3d:\n return ecsqlValue.getXYAndZ();\n case ECSqlValueType.String:\n return ecsqlValue.getString();\n default:\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type ${ecsqlValue.columnInfo.getType()} of the ECSQL Value`);\n }\n }\n\n public static queryClassName(ecdb: ECDb, classId: Id64String, tableSpace?: string): string {\n if (!tableSpace)\n tableSpace = \"main\";\n\n 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=?`,\n (stmt: ECSqlStatement) => {\n stmt.bindId(1, classId);\n if (stmt.step() !== DbResult.BE_SQLITE_ROW)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `No class found with ECClassId ${classId} in table space ${tableSpace}.`);\n\n return `${stmt.getValue(0).getString()}.${stmt.getValue(1).getString()}`;\n });\n }\n}\n\nclass ECSqlTypeHelper {\n public static isBlob(val: any): val is Uint8Array { return val instanceof Uint8Array; }\n\n public static isXAndY(val: any): val is XAndY { return XYZ.isXAndY(val); }\n public static isXYAndZ(val: any): val is XYAndZ { return XYZ.isXYAndZ(val); }\n public static isLowAndHighXYZ(arg: any): arg is LowAndHighXYZ { return arg.low !== undefined && ECSqlTypeHelper.isXYAndZ(arg.low) && arg.high !== undefined && ECSqlTypeHelper.isXYAndZ(arg.high); }\n\n public static isNavigationBindingValue(val: any): val is NavigationBindingValue { return val.id !== undefined && typeof (val.id) === \"string\"; }\n}\n"]}
1
+ {"version":3,"file":"ECSqlStatement.js","sourceRoot":"","sources":["../../src/ECSqlStatement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4F;AAC5F,wDAAkF;AAClF,oDAA0J;AAG1J,8DAAyD;AAEzD;;;;;;;;;GASG;AACH,MAAa,iBAAiB;IAC5B,YAA0B,MAAgB,EAAS,EAAe;QAAxC,WAAM,GAAN,MAAM,CAAU;QAAS,OAAE,GAAF,EAAE,CAAa;IAAI,CAAC;CACxE;AAFD,8CAEC;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,cAAc;IAA3B;QAGU,WAAM,GAAG,IAAI,iCAAmB,CAAC,EAAE,CAAC,CAAC;IA2V/C,CAAC;IAzVC,IAAW,GAAG,KAAK,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,+DAA+D;IAEvG,oEAAoE;IACpE,IAAW,UAAU,KAAc,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAEzD;;;;;;;OAOG;IACI,OAAO,CAAC,EAA8C,EAAE,KAAa,EAAE,SAAS,GAAG,IAAI;QAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,MAAM,KAAK,uBAAQ,CAAC,YAAY,EAAE,CAAC;YAC1C,MAAM,IAAI,yBAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;IAC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,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAED,MAAM,eAAe;IACZ,MAAM,CAAC,MAAM,CAAC,GAAQ,IAAuB,OAAO,GAAG,YAAY,UAAU,CAAC,CAAC,CAAC;IAEhF,MAAM,CAAC,OAAO,CAAC,GAAQ,IAAkB,OAAO,mBAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,CAAC,QAAQ,CAAC,GAAQ,IAAmB,OAAO,mBAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,CAAC,eAAe,CAAC,GAAQ,IAA0B,OAAO,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7L,MAAM,CAAC,wBAAwB,CAAC,GAAQ,IAAmC,OAAO,GAAG,CAAC,EAAE,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC;CACjJ","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ECSQL\n */\n\nimport { assert, DbResult, GuidString, Id64String, IDisposable } from \"@itwin/core-bentley\";\nimport { LowAndHighXYZ, Range3d, XAndY, XYAndZ, XYZ } from \"@itwin/core-geometry\";\nimport { ECJsNames, ECSqlValueType, IModelError, NavigationBindingValue, NavigationValue, PropertyMetaDataMap, QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { ECDb } from \"./ECDb\";\nimport { IModelNative } from \"./internal/NativePlatform\";\n\n/** The result of an **ECSQL INSERT** statement as returned from [ECSqlStatement.stepForInsert]($backend).\n *\n * If the step was successful, the ECSqlInsertResult contains\n * [DbResult.BE_SQLITE_DONE]($core-bentley)\n * and the ECInstanceId of the newly created instance.\n * In case of failure it contains the [DbResult]($core-bentley) error code.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n * @public\n */\nexport class ECSqlInsertResult {\n public constructor(public status: DbResult, public id?: Id64String) { }\n}\n\n/**\n * Arguments supplied to [[ECSqlStatement.getRow]].\n * @public\n * */\nexport interface ECSqlRowArg {\n /** Determine row format. */\n rowFormat?: QueryRowFormat;\n /**\n * Determine if classIds are converted to class names.\n */\n classIdsToClassNames?: boolean;\n}\n\n/** Executes ECSQL statements.\n *\n * A statement must be prepared before it can be executed, and it must be released when no longer needed.\n * See [IModelDb.withPreparedStatement]($backend) or\n * [ECDb.withPreparedStatement]($backend) for a convenient and\n * reliable way to prepare, execute, and then release a statement.\n *\n * A statement may contain parameters that must be filled in before use by the **bind** methods.\n *\n * Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.step]($backend).\n * In case of an **ECSQL SELECT** statement, the current row can be retrieved with [ECSqlStatement.getRow]($backend) as\n * a whole, or with [ECSqlStatement.getValue]($backend) when individual values are needed.\n * Alternatively, query results of an **ECSQL SELECT** statement can be stepped through by using\n * standard iteration syntax, such as `for of`.\n *\n * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared\n * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.\n * > 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.\n *\n * See also\n * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL\n * @public\n * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.\n * For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.\n * [IModelDb.createQueryReader]($backend) is an asynchronous API. If you encounter a use case that cannot be converted to async, please report an issue at https://github.com/iTwin/itwinjs-core/issues.\n * Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\nexport class ECSqlStatement implements IterableIterator<any>, IDisposable {\n private _stmt: IModelJsNative.ECSqlStatement | undefined;\n private _sql: string | undefined;\n private _props = new PropertyMetaDataMap([]);\n\n public get sql() { return this._sql!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** Check if this statement has been prepared successfully or not */\n public get isPrepared(): boolean { return !!this._stmt; }\n\n /** Prepare this statement prior to first use.\n * @param db The DgnDb or ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not\n * @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.\n * The error.message property will provide details.\n * @internal\n */\n public prepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors = true): void {\n const stat = this.tryPrepare(db, ecsql, logErrors);\n if (stat.status !== DbResult.BE_SQLITE_OK) {\n throw new IModelError(stat.status, stat.message);\n }\n }\n\n /** Prepare this statement prior to first use.\n * @param db The DgnDb or ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()\n * @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.\n * @internal\n */\n public tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors = false): { status: DbResult, message: string } {\n if (this.isPrepared)\n throw new Error(\"ECSqlStatement is already prepared\");\n this._sql = ecsql;\n this._stmt = new IModelNative.platform.ECSqlStatement();\n return this._stmt.prepare(db, ecsql, logErrors);\n }\n\n /** Reset this statement so that the next call to step will return the first row, if any. */\n public reset(): void {\n assert(undefined !== this._stmt);\n this._stmt.reset();\n this._props = new PropertyMetaDataMap([]);\n }\n\n /** Get the Native SQL statement\n * @internal\n */\n public getNativeSql(): string {\n assert(undefined !== this._stmt);\n return this._stmt.getNativeSql();\n }\n\n /** Call this function when finished with this statement. This releases the native resources held by the statement.\n *\n * > Do not call this method directly on a statement that is being managed by a statement cache.\n */\n public dispose(): void {\n if (this._stmt) {\n this._stmt.dispose(); // free native statement\n this._stmt = undefined;\n }\n }\n\n /** Binds the specified value to the specified ECSQL parameter.\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindValue(parameter: number | string, val: any): void { this.getBinder(parameter).bind(val); }\n\n /** Binds null to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindNull(parameter: number | string): void { this.getBinder(parameter).bindNull(); }\n\n /** Binds a BLOB value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string\n */\n public bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void { this.getBinder(parameter).bindBlob(blob); }\n\n /** Binds a boolean value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Boolean value\n */\n public bindBoolean(parameter: number | string, val: boolean): void { this.getBinder(parameter).bindBoolean(val); }\n\n /** Binds a DateTime value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param isoDateTimeString DateTime value as ISO8601 string\n */\n public bindDateTime(parameter: number | string, isoDateTimeString: string): void { this.getBinder(parameter).bindDateTime(isoDateTimeString); }\n\n /** Binds a double value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Double value\n */\n public bindDouble(parameter: number | string, val: number): void { this.getBinder(parameter).bindDouble(val); }\n\n /** Binds an GUID value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val GUID value\n */\n public bindGuid(parameter: number | string, val: GuidString): void { this.getBinder(parameter).bindGuid(val); }\n\n /** Binds an Id value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Id value\n */\n public bindId(parameter: number | string, val: Id64String): void { this.getBinder(parameter).bindId(val); }\n\n /** Binds an integer value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Integer value as number, decimal string or hexadecimal string.\n */\n public bindInteger(parameter: number | string, val: number | string): void { this.getBinder(parameter).bindInteger(val); }\n\n /** Binds an Point2d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point2d value\n */\n public bindPoint2d(parameter: number | string, val: XAndY): void { this.getBinder(parameter).bindPoint2d(val); }\n\n /** Binds an Point3d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point3d value\n */\n public bindPoint3d(parameter: number | string, val: XYAndZ): void { this.getBinder(parameter).bindPoint3d(val); }\n\n /** Binds a Range3d as a blob to the specified ECSQL parameter\n * @param parameter Index(1-based) or name of the parameter\n * @param val Range3d value\n */\n public bindRange3d(parameter: number | string, val: LowAndHighXYZ): void { this.getBinder(parameter).bindRange3d(val); }\n\n /** Binds an string to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val String value\n */\n public bindString(parameter: number | string, val: string): void { this.getBinder(parameter).bindString(val); }\n\n /** Binds a navigation property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Navigation property value\n */\n public bindNavigation(parameter: number | string, val: NavigationBindingValue): void { this.getBinder(parameter).bindNavigation(val); }\n\n /** Binds a struct property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value\n * (of one of the supported types)\n */\n public bindStruct(parameter: number | string, val: object): void { this.getBinder(parameter).bindStruct(val); }\n\n /** Binds an array value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Array value. The array value is an array of values of the supported types\n */\n public bindArray(parameter: number | string, val: any[]): void { this.getBinder(parameter).bindArray(val); }\n\n public bindIdSet(parameter: number | string, val: Id64String[]): void { this.getBinder(parameter).bindIdSet(val); }\n /**\n * Gets a binder to bind a value for an ECSQL parameter\n * > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods\n * > or [ECSqlStatement.bindValues]($backend).\n * @param parameter Index (1-based) or name of the parameter\n */\n public getBinder(parameter: string | number): ECSqlBinder {\n assert(undefined !== this._stmt);\n return new ECSqlBinder(this._stmt.getBinder(parameter));\n }\n\n /** Bind values to all parameters in the statement.\n * @param values The values to bind to the parameters.\n * Pass an *array* of values if the parameters are *positional*.\n * Pass an *object of the values keyed on the parameter name* for *named parameters*.\n * The values in either the array or object must match the respective types of the parameter.\n *\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n *\n * See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)\n */\n public bindValues(values: any[] | object): void {\n if (Array.isArray(values)) {\n for (let i = 0; i < values.length; i++) {\n const paramIndex: number = i + 1;\n const paramValue: any = values[i];\n if (paramValue === undefined || paramValue === null)\n continue;\n\n this.bindValue(paramIndex, paramValue);\n }\n return;\n }\n\n for (const entry of Object.entries(values)) {\n const paramName: string = entry[0];\n const paramValue: any = entry[1];\n if (paramValue === undefined || paramValue === null)\n continue;\n\n this.bindValue(paramName, paramValue);\n }\n }\n\n /** Clear any bindings that were previously set on this statement.\n * @throws [IModelError]($common) in case of errors\n */\n public clearBindings(): void {\n if (this._stmt) {\n const stat: DbResult = this._stmt.clearBindings();\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error clearing bindings\");\n }\n }\n\n /** Step this statement to the next row.\n *\n * For **ECSQL SELECT** statements the method returns\n * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.\n * - Error status in case of errors.\n *\n * For **ECSQL INSERT, UPDATE, DELETE** statements the method returns\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.\n * - Error status in case of errors.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n *\n * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples)\n */\n public step(): DbResult { return this._stmt!.step(); } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** @internal added this back in for testing purposes */\n public async stepAsync(): Promise<DbResult> {\n return new Promise((resolve, _reject) => {\n this._stmt!.stepAsync(resolve); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n });\n }\n\n /** Step this INSERT statement and returns status and the ECInstanceId of the newly\n * created instance.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n *\n * @returns Returns the generated ECInstanceId in case of success and the status of the step\n * call. In case of error, the respective error code is returned.\n */\n public stepForInsert(): ECSqlInsertResult {\n assert(undefined !== this._stmt);\n const r: { status: DbResult, id: string } = this._stmt.stepForInsert();\n if (r.status === DbResult.BE_SQLITE_DONE)\n return new ECSqlInsertResult(r.status, r.id);\n\n return new ECSqlInsertResult(r.status);\n }\n\n /** Get the query result's column count (only for ECSQL SELECT statements). */\n public getColumnCount(): number { return this._stmt!.getColumnCount(); } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n /** Get the current row.\n * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.\n *\n * See also:\n * - [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned row.\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n */\n public getRow(args?: ECSqlRowArg): any {\n if (!this._stmt)\n throw new Error(\"ECSqlStatement is not prepared\");\n\n args = args ?? {};\n if (args.rowFormat === undefined) {\n args.rowFormat = QueryRowFormat.UseJsPropertyNames;\n }\n const resp = this._stmt.toRow({\n classIdsToClassNames: args.classIdsToClassNames,\n useJsName: args.rowFormat === QueryRowFormat.UseJsPropertyNames,\n abbreviateBlobs: false,\n // In 4.x, people are currently dependent on the behavior of aliased classIds `select classId as aliasedClassId` not being\n // converted into classNames which is a bug that we must now support.This option preserves this special behavior until\n // it can be removed in a future version.\n doNotConvertClassIdsToClassNamesWhenAliased: true,\n });\n return this.formatCurrentRow(resp, args.rowFormat);\n }\n\n private formatCurrentRow(currentResp: any, rowFormat: QueryRowFormat = QueryRowFormat.UseJsPropertyNames): any[] | object {\n if (!this._stmt)\n throw new Error(\"ECSqlStatement is not prepared\");\n\n if (rowFormat === QueryRowFormat.UseECSqlPropertyIndexes)\n return currentResp.data;\n\n if (this._props.length === 0) {\n const resp = this._stmt.getMetadata();\n this._props = new PropertyMetaDataMap(resp.meta);\n }\n const formattedRow = {};\n for (const prop of this._props) {\n const propName = rowFormat === QueryRowFormat.UseJsPropertyNames ? prop.jsonName : prop.name;\n const val = currentResp.data[prop.index];\n if (typeof val !== \"undefined\" && val !== null) {\n Object.defineProperty(formattedRow, propName, {\n value: val,\n enumerable: true,\n writable: true,\n });\n }\n }\n return formattedRow;\n }\n\n /** Calls step when called as an iterator.\n *\n * Each iteration returns an [ECSQL row format]($docs/learning/ECSQLRowFormat) as returned\n * from [ECSqlStatement.getRow]($backend).\n */\n public next(): IteratorResult<any> {\n if (DbResult.BE_SQLITE_ROW === this.step()) {\n return {\n done: false,\n value: this.getRow(),\n };\n } else {\n return {\n done: true,\n value: undefined,\n };\n }\n }\n\n /** The iterator that will step through the results of this statement. */\n public [Symbol.iterator](): IterableIterator<any> { return this; }\n\n /** Get the value for the column at the given index in the query result.\n * @param columnIx Index of ECSQL column in query result (0-based)\n *\n * See also: [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public getValue(columnIx: number): ECSqlValue {\n assert(undefined !== this._stmt);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return new ECSqlValue(this._stmt.getValue(columnIx));\n }\n}\n\n/** Executes ECSQL INSERT/UPDATE/DELETE statements.\n *\n * A statement must be prepared before it can be executed, and it must be released when no longer needed.\n * See [ECDb.withCachedWriteStatement]($backend) for a convenient and\n * reliable way to prepare, execute, and then release a statement.\n *\n * A statement may contain parameters that must be filled in before use by the **bind** methods.\n *\n * Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.stepForInsert]($backend).\n *\n * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared\n * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.\n * > 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.\n *\n * See also\n * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL\n * @public\n */\nexport class ECSqlWriteStatement implements IDisposable {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _stmt: ECSqlStatement;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public constructor(stmt?: ECSqlStatement) {\n if (stmt)\n this._stmt = stmt;\n else {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this._stmt = new ECSqlStatement();\n }\n }\n\n public get sql() { return this._stmt.sql; }\n\n /** Check if this statement has been prepared successfully or not */\n public get isPrepared(): boolean { return this._stmt.isPrepared; }\n\n /** Get the underlying ECSqlStatement. Needed until we remove ECSqlStatement.\n * @param\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public get stmt(): ECSqlStatement { return this._stmt; }\n\n /** Prepare this statement prior to first use.\n * @param db The ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not\n * @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.\n * The error.message property will provide details.\n * @internal\n */\n public prepare(db: IModelJsNative.ECDb, ecsql: string, logErrors = true): void {\n this._stmt.prepare(db, ecsql, logErrors);\n }\n\n /** Prepare this statement prior to first use.\n * @param db The DgnDb or ECDb to prepare the statement against\n * @param ecsql The ECSQL statement string to prepare\n * @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()\n * @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.\n * @internal\n */\n public tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors = false): { status: DbResult, message: string } {\n return this.tryPrepare(db, ecsql, logErrors);\n }\n\n /** Reset this statement so that the next call to step will return the first row, if any. */\n public reset(): void {\n this._stmt.reset();\n }\n\n /** Get the Native SQL statement\n * @internal\n */\n public getNativeSql(): string {\n return this._stmt.getNativeSql();\n }\n\n /** Call this function when finished with this statement. This releases the native resources held by the statement.\n *\n * > Do not call this method directly on a statement that is being managed by a statement cache.\n */\n public dispose(): void {\n this._stmt.dispose(); // free native statement\n }\n\n /** Binds the specified value to the specified ECSQL parameter.\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindValue(parameter: number | string, val: any): void { this.getBinder(parameter).bind(val); }\n\n /** Binds null to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n */\n public bindNull(parameter: number | string): void { this.getBinder(parameter).bindNull(); }\n\n /** Binds a BLOB value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string\n */\n public bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void { this.getBinder(parameter).bindBlob(blob); }\n\n /** Binds a boolean value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Boolean value\n */\n public bindBoolean(parameter: number | string, val: boolean): void { this.getBinder(parameter).bindBoolean(val); }\n\n /** Binds a DateTime value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param isoDateTimeString DateTime value as ISO8601 string\n */\n public bindDateTime(parameter: number | string, isoDateTimeString: string): void { this.getBinder(parameter).bindDateTime(isoDateTimeString); }\n\n /** Binds a double value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Double value\n */\n public bindDouble(parameter: number | string, val: number): void { this.getBinder(parameter).bindDouble(val); }\n\n /** Binds an GUID value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val GUID value\n */\n public bindGuid(parameter: number | string, val: GuidString): void { this.getBinder(parameter).bindGuid(val); }\n\n /** Binds an Id value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Id value\n */\n public bindId(parameter: number | string, val: Id64String): void { this.getBinder(parameter).bindId(val); }\n\n /** Binds an integer value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Integer value as number, decimal string or hexadecimal string.\n */\n public bindInteger(parameter: number | string, val: number | string): void { this.getBinder(parameter).bindInteger(val); }\n\n /** Binds an Point2d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point2d value\n */\n public bindPoint2d(parameter: number | string, val: XAndY): void { this.getBinder(parameter).bindPoint2d(val); }\n\n /** Binds an Point3d value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Point3d value\n */\n public bindPoint3d(parameter: number | string, val: XYAndZ): void { this.getBinder(parameter).bindPoint3d(val); }\n\n /** Binds a Range3d as a blob to the specified ECSQL parameter\n * @param parameter Index(1-based) or name of the parameter\n * @param val Range3d value\n */\n public bindRange3d(parameter: number | string, val: LowAndHighXYZ): void { this.getBinder(parameter).bindRange3d(val); }\n\n /** Binds an string to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val String value\n */\n public bindString(parameter: number | string, val: string): void { this.getBinder(parameter).bindString(val); }\n\n /** Binds a navigation property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Navigation property value\n */\n public bindNavigation(parameter: number | string, val: NavigationBindingValue): void { this.getBinder(parameter).bindNavigation(val); }\n\n /** Binds a struct property value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value\n * (of one of the supported types)\n */\n public bindStruct(parameter: number | string, val: object): void { this.getBinder(parameter).bindStruct(val); }\n\n /** Binds an array value to the specified ECSQL parameter.\n * @param parameter Index (1-based) or name of the parameter\n * @param val Array value. The array value is an array of values of the supported types\n */\n public bindArray(parameter: number | string, val: any[]): void { this.getBinder(parameter).bindArray(val); }\n\n public bindIdSet(parameter: number | string, val: Id64String[]): void { this.getBinder(parameter).bindIdSet(val); }\n /**\n * Gets a binder to bind a value for an ECSQL parameter\n * > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods\n * > or [ECSqlStatement.bindValues]($backend).\n * @param parameter Index (1-based) or name of the parameter\n */\n public getBinder(parameter: string | number): ECSqlBinder {\n return this._stmt.getBinder(parameter);\n }\n\n /** Bind values to all parameters in the statement.\n * @param values The values to bind to the parameters.\n * Pass an *array* of values if the parameters are *positional*.\n * Pass an *object of the values keyed on the parameter name* for *named parameters*.\n * The values in either the array or object must match the respective types of the parameter.\n *\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n *\n * See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)\n */\n public bindValues(values: any[] | object): void {\n this._stmt.bindValues(values);\n }\n\n /** Clear any bindings that were previously set on this statement.\n * @throws [IModelError]($common) in case of errors\n */\n public clearBindings(): void {\n this._stmt.clearBindings();\n }\n\n /** Step this INSERT statement and returns status and the ECInstanceId of the newly\n * created instance.\n *\n * > Insert statements can be used with ECDb only, not with IModelDb.\n *\n * @returns Returns the generated ECInstanceId in case of success and the status of the step\n * call. In case of error, the respective error code is returned.\n */\n public stepForInsert(): ECSqlInsertResult {\n return this._stmt.stepForInsert();\n }\n\n /** Get the query result's column count (only for ECSQL SELECT statements). */\n public getColumnCount(): number { return this._stmt.getColumnCount(); }\n}\n\n/** Binds a value to an ECSQL parameter.\n *\n * See also:\n *\n * - [ECSqlStatement]($backend)\n * - [ECSqlStatement.getBinder]($backend)\n * - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL)\n * @public\n */\nexport class ECSqlBinder {\n private _binder: IModelJsNative.ECSqlBinder;\n\n /** @internal */\n public constructor(binder: IModelJsNative.ECSqlBinder) { this._binder = binder; }\n\n /** Binds the specified value to the ECSQL parameter.\n * The section \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" describes the\n * iTwin.js types to be used for the different ECSQL parameter types.\n * @param val Value to bind\n */\n public bind(val: any): void {\n ECSqlBindingHelper.bindValue(this, val);\n }\n\n /** Binds null to the ECSQL parameter. */\n public bindNull(): void {\n const stat: DbResult = this._binder.bindNull();\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding null\");\n }\n\n /** Binds a BLOB value to the ECSQL parameter.\n * @param BLOB value as either a UInt8Array, ArrayBuffer or a Base64 string\n */\n public bindBlob(blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void {\n const stat: DbResult = this._binder.bindBlob(blob);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding blob\");\n }\n\n /** Binds a boolean value to the ECSQL parameter.\n * @param val Boolean value\n */\n public bindBoolean(val: boolean): void {\n const stat: DbResult = this._binder.bindBoolean(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding boolean\");\n }\n\n /** Binds a DateTime value to the ECSQL parameter.\n * @param isoDateTimeString DateTime value as ISO8601 string\n */\n public bindDateTime(isoDateTimeString: string): void {\n const stat: DbResult = this._binder.bindDateTime(isoDateTimeString);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding DateTime\");\n }\n\n /** Binds a double value to the ECSQL parameter.\n * @param val Double value\n */\n public bindDouble(val: number): void {\n const stat: DbResult = this._binder.bindDouble(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding double\");\n }\n\n /** Binds an GUID value to the ECSQL parameter.\n * @param val GUID value. If passed as string, it must be formatted as described in [GuidString]($core-bentley).\n */\n public bindGuid(val: GuidString): void {\n const stat: DbResult = this._binder.bindGuid(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding GUID\");\n }\n\n /** Binds an Id value to the ECSQL parameter.\n * @param val Id value. If passed as string it must be the hexadecimal representation of the Id.\n */\n public bindId(val: Id64String): void {\n const stat: DbResult = this._binder.bindId(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Id\");\n }\n\n /** Binds an integer value to the ECSQL parameter.\n * @param val Integer value as number, decimal string or hexadecimal string.\n */\n public bindInteger(val: number | string): void {\n const stat: DbResult = this._binder.bindInteger(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding integer\");\n }\n\n /** Binds an Point2d value to the ECSQL parameter.\n * @param val Point2d value\n */\n public bindPoint2d(val: XAndY): void {\n const stat: DbResult = this._binder.bindPoint2d(val.x, val.y);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Point2d\");\n }\n\n /** Binds an Point3d value to the ECSQL parameter.\n * @param val Point3d value\n */\n public bindPoint3d(val: XYAndZ): void {\n const stat: DbResult = this._binder.bindPoint3d(val.x, val.y, val.z);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Point3d\");\n }\n\n /** Binds a Range3d as a blob to the ECSQL parameter.\n * @param val Range3d value\n */\n public bindRange3d(val: LowAndHighXYZ): void {\n const stat: DbResult = this._binder.bindBlob(Range3d.toFloat64Array(val).buffer);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding Range3d\");\n }\n\n /** Binds an string to the ECSQL parameter.\n * @param val String value\n */\n public bindString(val: string): void {\n const stat: DbResult = this._binder.bindString(val);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding string\");\n }\n\n /** Binds a navigation property value to the ECSQL parameter.\n * @param val Navigation property value\n */\n public bindNavigation(val: NavigationBindingValue): void {\n const stat: DbResult = this._binder.bindNavigation(val.id, val.relClassName, val.relClassTableSpace);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding navigation property\");\n }\n\n /** Binds a struct property value to the ECSQL parameter.\n * @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value\n * (of one of the supported types)\n */\n public bindStruct(val: object): void { ECSqlBindingHelper.bindStruct(this, val); }\n\n /** Gets the binder for the specified member of a struct parameter\n *\n * > This is the most low-level way to bind struct parameters with most flexibility. A simpler alternative is\n * > to just call [ECSqlBinder.bindStruct]($backend).\n */\n public bindMember(memberName: string): ECSqlBinder { return new ECSqlBinder(this._binder.bindMember(memberName)); }\n\n /** Binds a set of Id strings to the ECSQL parameter.\n * @param val array of Id values. If passed as string they must be the hexadecimal representation of the Ids.\n */\n public bindIdSet(vector: Id64String[]): void {\n const stat: DbResult = this._binder.bindIdSet(vector);\n if (stat !== DbResult.BE_SQLITE_OK)\n throw new IModelError(stat, \"Error binding id set\");\n }\n\n /** Binds an array value to the ECSQL parameter.\n * @param val Array value. The array value is an array of values of the supported types\n */\n public bindArray(val: any[]): void { ECSqlBindingHelper.bindArray(this, val); }\n\n /** Adds a new array element to the array parameter and returns the binder for the new array element\n *\n * > This is the most low-level way to bind array parameters with most flexibility. A simpler alternative is\n * > to just call [ECSqlBinder.bindArray]($backend).\n */\n public addArrayElement(): ECSqlBinder { return new ECSqlBinder(this._binder.addArrayElement()); }\n}\n\n/** Represents the value of an ECEnumeration.\n *\n * See also:\n * - [[ECSqlValue.getEnum]]\n * - [[ECSqlStatement]]\n * - [[ECSqlStatement.getValue]]\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n * @public\n * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.\n * For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.\n * [IModelDb.createQueryReader]($backend) is an asynchronous API. If you encounter a use case that cannot be converted to async, please report an issue at https://github.com/iTwin/itwinjs-core/issues.\n * Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\nexport interface ECEnumValue {\n schema: string;\n name: string;\n key: string;\n value: number | string;\n}\n\n/** Value of a column in a row of an ECSQL query result.\n *\n * See also:\n * - [ECSqlStatement]($backend)\n * - [ECSqlStatement.getValue]($backend)\n * - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)\n * @public\n * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.\n * For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.\n * [IModelDb.createQueryReader]($backend) is an asynchronous API. If you encounter a use case that cannot be converted to async, please report an issue at https://github.com/iTwin/itwinjs-core/issues.\n * Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n*/\nexport class ECSqlValue {\n private _val: IModelJsNative.ECSqlValue;\n\n /** @internal */\n public constructor(val: IModelJsNative.ECSqlValue) { this._val = val; }\n\n /** Get information about the query result's column this value refers to. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public get columnInfo(): ECSqlColumnInfo { return this._val.getColumnInfo() as ECSqlColumnInfo; }\n\n /** Get the value of this ECSQL value */\n public get value(): any { return ECSqlValueHelper.getValue(this); }\n\n /** Indicates whether the value is NULL or not. */\n public get isNull(): boolean { return this._val.isNull(); }\n /** Get the value as BLOB */\n public getBlob(): Uint8Array { return this._val.getBlob(); }\n /** Get the value as a boolean value */\n public getBoolean(): boolean { return this._val.getBoolean(); }\n /** Get the value as a DateTime value (formatted as ISO8601 string) */\n public getDateTime(): string { return this._val.getDateTime(); }\n /** Get the value as a double value */\n public getDouble(): number { return this._val.getDouble(); }\n /** Get the value as a IGeometry value (as ECJSON IGeometry) */\n public getGeometry(): any { return JSON.parse(this._val.getGeometry()); }\n /** Get the value as a GUID (formatted as GUID string).\n * See [GuidString]($core-bentley)\n */\n public getGuid(): GuidString { return this._val.getGuid(); }\n /** Get the value as a Id (formatted as hexadecimal string). */\n public getId(): Id64String { return this._val.getId(); }\n /** Get the ClassId value formatted as fully qualified class name. */\n public getClassNameForClassId(): string { return this._val.getClassNameForClassId(); }\n /** Get the value as a integer value */\n public getInteger(): number { return this._val.getInt64(); }\n /** Get the value as a string value */\n public getString(): string { return this._val.getString(); }\n /** Get the value as [XAndY]($core-geometry) */\n public getXAndY(): XAndY { return this._val.getPoint2d(); }\n /** Get the value as [XYAndZ]($core-geometry) */\n public getXYAndZ(): XYAndZ { return this._val.getPoint3d(); }\n /** Get the value as ECEnumeration value\n * Note: This method is optional. Using [[ECSqlValue.getInteger]] for integral enums and\n * [[ECSqlValue.getString]] for string enums respectively are the usual way to get\n * enum values. This method can be used if the context of the underlying ECEnumeration\n * is required.\n * The value is broken down into the ECEnumerators that make it up, if the value\n * is a combination of ECEnumerators. If the value is not a strict match of an ECEnumerator\n * or a combination of them, undefined is returned.\n * > Note: You can call [[ECSqlValue.columnInfo.isEnum]] to find out whether\n * > this method can be called or not.\n * @return ECEnumeration value(s) or undefined if the ECSqlValue does not represent an ECEnumeration.\n * or is not a strict match of an ECEnumerator or a combination of them.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public getEnum(): ECEnumValue[] | undefined { return this._val.getEnum(); }\n\n /** Get the value as [NavigationValue]($common) */\n public getNavigation(): NavigationValue { return this._val.getNavigation(); }\n\n /** Get an iterator for iterating the struct members of this struct value. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public getStructIterator(): ECSqlValueIterator { return new ECSqlValueIterator(this._val.getStructIterator()); }\n\n /** Get this struct value's content as object literal */\n public getStruct(): any { return ECSqlValueHelper.getStruct(this); }\n\n /** Get an iterator for iterating the array elements of this array value. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public getArrayIterator(): ECSqlValueIterator { return new ECSqlValueIterator(this._val.getArrayIterator()); }\n\n /** Get this array value as JavaScript array */\n public getArray(): any[] { return ECSqlValueHelper.getArray(this); }\n}\n\n/** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).\n * See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).\n * @public\n * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.\n * For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.\n * [IModelDb.createQueryReader]($backend) is an asynchronous API. If you encounter a use case that cannot be converted to async, please report an issue at https://github.com/iTwin/itwinjs-core/issues.\n * Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n*/\nexport class ECSqlValueIterator implements IterableIterator<ECSqlValue> {\n private _it: IModelJsNative.ECSqlValueIterator;\n\n /** @internal */\n public constructor(it: IModelJsNative.ECSqlValueIterator) { this._it = it; }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public next(): IteratorResult<ECSqlValue> {\n if (this._it.moveNext()) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return { done: false, value: new ECSqlValue(this._it.getCurrent()) };\n }\n return { done: true, value: undefined };\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public [Symbol.iterator](): IterableIterator<ECSqlValue> { return this; }\n}\n\n/** Information about an ECSQL column in an ECSQL query result.\n * See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)\n * @public\n * @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.\n * For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.\n * [IModelDb.createQueryReader]($backend) is an asynchronous API. If you encounter a use case that cannot be converted to async, please report an issue at https://github.com/iTwin/itwinjs-core/issues.\n * Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\nexport interface ECSqlColumnInfo {\n /** Gets the data type of the column.\n */\n getType(): ECSqlValueType;\n\n /** Gets the name of the property backing the column.\n * > If this column is backed by a generated property, i.e. it represents ECSQL expression,\n * > the access string consists of the name of the generated property. [[ECSqlColumnInfo.getOriginPropertyName]]\n * > can be used to obtain the non-aliased name in that case.\n */\n getPropertyName(): string;\n\n /** Gets the name of the original property that the column data is from.\n * > Other than [[ECSqlColumnInfo.getPropertyName]], this ignores aliases and allows getting the name\n * > of the property which is being used for the column. A column may not be backed\n * > by a property, in which case this returns undefined.\n */\n getOriginPropertyName(): string | undefined;\n\n /** Gets the full access string to the corresponding ECSqlValue starting from the root class.\n * > If this column is backed by a generated property, i.e. it represents ECSQL expression,\n * > the access string consists of the ECSQL expression.\n */\n getAccessString(): string;\n\n /** Indicates whether the column refers to an ECEnumeration property. */\n isEnum(): boolean;\n\n /** Indicates whether the column refers to a system property (e.g. id, className). */\n isSystemProperty(): boolean;\n\n /** Indicates whether the column is backed by a generated property or not. For SELECT clause items that are expressions other\n * than simply a reference to an ECProperty, a property is generated containing the expression name.\n */\n isGeneratedProperty(): boolean;\n\n /** Gets the table space in which this root class is persisted.\n * > For classes in the primary file the table space is MAIN. For classes in attached\n * > files, the table space is the name by which the file was attached. For generated properties the table space is empty.\n */\n getRootClassTableSpace(): string;\n\n /** Gets the fully qualified name of the ECClass of the top-level ECProperty backing this column. */\n getRootClassName(): string;\n\n /** Gets the class alias of the root class to which the column refers to.\n * > Returns an empty string if no class alias was specified in the select clause.\n */\n getRootClassAlias(): string;\n}\n\nclass ECSqlBindingHelper {\n\n /** Binds the specified value to the specified binder\n * @param binder Parameter Binder to bind to\n * @param val Value to be bound. (See [iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes))\n * @throws IModelError in case of errors\n */\n public static bindValue(binder: ECSqlBinder, val: any): void {\n // returns false if val is no primitive and returns true if it is primitive and a binding call was done\n if (ECSqlBindingHelper.tryBindPrimitiveTypes(binder, val))\n return;\n\n if (Array.isArray(val)) {\n ECSqlBindingHelper.bindArray(binder, val);\n return;\n }\n\n if (typeof (val) === \"object\") {\n ECSqlBindingHelper.bindStruct(binder, val);\n return;\n }\n\n throw new Error(`Bound value is of an unsupported type: ${val}`);\n }\n\n /** Binds the specified primitive value to the specified binder\n * @param binder Parameter Binder to bind to\n * @param val Primitive value to be bound. Must be of one of these types described here:\n * [ECSQL Binding types]($docs/learning/ECSQLParameterTypes)\n * @throws IModelError in case of errors\n */\n public static bindPrimitive(binder: ECSqlBinder, val: any): void {\n if (!ECSqlBindingHelper.tryBindPrimitiveTypes(binder, val))\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Binding value is of an unsupported primitive type: ${val}`);\n }\n\n /** Binds the specified object to the specified struct binder\n * @param binder Struct parameter binder to bind to\n * @param val Value to be bound. Must be an Object with members of the supported types\n * @throws IModelError in case of errors\n */\n public static bindStruct(binder: ECSqlBinder, val: object): void {\n if (val === null || val === undefined) {\n binder.bindNull();\n return;\n }\n\n for (const member of Object.entries(val)) {\n const memberName: string = member[0];\n const memberVal: any = member[1];\n ECSqlBindingHelper.bindValue(binder.bindMember(memberName), memberVal);\n }\n }\n\n /** Binds the specified array to the specified array binder\n * @param binder Array parameter binder to bind to\n * @param val Value to be bound. Must be an Array with elements of the supported types\n * @throws IModelError in case of errors\n */\n public static bindArray(binder: ECSqlBinder, val: any[]): void {\n if (val === null || val === undefined) {\n binder.bindNull();\n return;\n }\n\n for (const element of val) {\n ECSqlBindingHelper.bindValue(binder.addArrayElement(), element);\n }\n }\n\n /** tries to interpret the passed value as known leaf types (primitives and navigation values).\n * @returns Returns undefined if the value wasn't a primitive. DbResult if it was a primitive and was bound to the binder\n */\n private static tryBindPrimitiveTypes(binder: ECSqlBinder, val: any): boolean {\n if (val === undefined || val === null) {\n binder.bindNull();\n return true;\n }\n\n if (typeof (val) === \"number\") {\n if (Number.isInteger(val))\n binder.bindInteger(val);\n else\n binder.bindDouble(val);\n\n return true;\n }\n\n if (typeof (val) === \"boolean\") {\n binder.bindBoolean(val);\n return true;\n }\n\n if (typeof (val) === \"string\") {\n binder.bindString(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isBlob(val)) {\n binder.bindBlob(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isXYAndZ(val)) {\n binder.bindPoint3d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isXAndY(val)) {\n binder.bindPoint2d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isLowAndHighXYZ(val)) {\n binder.bindRange3d(val);\n return true;\n }\n\n if (ECSqlTypeHelper.isNavigationBindingValue(val)) {\n binder.bindNavigation(val);\n return true;\n }\n\n return false;\n }\n}\n\nclass ECSqlValueHelper {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static getValue(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n const dataType: ECSqlValueType = ecsqlValue.columnInfo.getType();\n switch (dataType) {\n case ECSqlValueType.Struct:\n return ECSqlValueHelper.getStruct(ecsqlValue);\n\n case ECSqlValueType.Navigation:\n return ecsqlValue.getNavigation();\n\n case ECSqlValueType.PrimitiveArray:\n case ECSqlValueType.StructArray:\n return ECSqlValueHelper.getArray(ecsqlValue);\n\n default:\n return ECSqlValueHelper.getPrimitiveValue(ecsqlValue);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static getStruct(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n const structVal = {};\n const it = ecsqlValue.getStructIterator();\n try {\n for (const memberECSqlVal of it) {\n if (memberECSqlVal.isNull)\n continue;\n\n const memberName: string = ECJsNames.toJsName(memberECSqlVal.columnInfo.getPropertyName());\n const memberVal = ECSqlValueHelper.getValue(memberECSqlVal);\n Object.defineProperty(structVal, memberName, { enumerable: true, configurable: true, writable: true, value: memberVal });\n }\n } finally {\n }\n\n return structVal;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static getArray(ecsqlValue: ECSqlValue): any[] {\n const arrayVal: any[] = [];\n const it = ecsqlValue.getArrayIterator();\n try {\n for (const elementECSqlVal of it) {\n const memberVal = ECSqlValueHelper.getValue(elementECSqlVal);\n arrayVal.push(memberVal);\n }\n } finally {\n }\n return arrayVal;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private static getPrimitiveValue(ecsqlValue: ECSqlValue): any {\n if (ecsqlValue.isNull)\n return undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const colInfo: ECSqlColumnInfo = ecsqlValue.columnInfo;\n switch (colInfo.getType()) {\n case ECSqlValueType.Blob:\n return ecsqlValue.getBlob();\n case ECSqlValueType.Boolean:\n return ecsqlValue.getBoolean();\n case ECSqlValueType.DateTime:\n return ecsqlValue.getDateTime();\n case ECSqlValueType.Double:\n return ecsqlValue.getDouble();\n case ECSqlValueType.Geometry:\n return ecsqlValue.getGeometry();\n case ECSqlValueType.Guid:\n return ecsqlValue.getGuid();\n case ECSqlValueType.Id: {\n if (colInfo.isSystemProperty() && colInfo.getPropertyName().endsWith(\"ECClassId\"))\n return ecsqlValue.getClassNameForClassId();\n\n return ecsqlValue.getId();\n }\n case ECSqlValueType.Int:\n case ECSqlValueType.Int64:\n return ecsqlValue.getInteger();\n case ECSqlValueType.Point2d:\n return ecsqlValue.getXAndY();\n case ECSqlValueType.Point3d:\n return ecsqlValue.getXYAndZ();\n case ECSqlValueType.String:\n return ecsqlValue.getString();\n default:\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type ${ecsqlValue.columnInfo.getType()} of the ECSQL Value`);\n }\n }\n\n public static queryClassName(ecdb: ECDb, classId: Id64String, tableSpace?: string): string {\n if (!tableSpace)\n tableSpace = \"main\";\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n 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=?`,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (stmt: ECSqlStatement) => {\n stmt.bindId(1, classId);\n if (stmt.step() !== DbResult.BE_SQLITE_ROW)\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `No class found with ECClassId ${classId} in table space ${tableSpace}.`);\n\n return `${stmt.getValue(0).getString()}.${stmt.getValue(1).getString()}`;\n });\n }\n}\n\nclass ECSqlTypeHelper {\n public static isBlob(val: any): val is Uint8Array { return val instanceof Uint8Array; }\n\n public static isXAndY(val: any): val is XAndY { return XYZ.isXAndY(val); }\n public static isXYAndZ(val: any): val is XYAndZ { return XYZ.isXYAndZ(val); }\n public static isLowAndHighXYZ(arg: any): arg is LowAndHighXYZ { return arg.low !== undefined && ECSqlTypeHelper.isXYAndZ(arg.low) && arg.high !== undefined && ECSqlTypeHelper.isXYAndZ(arg.high); }\n\n public static isNavigationBindingValue(val: any): val is NavigationBindingValue { return val.id !== undefined && typeof (val.id) === \"string\"; }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementAspect.d.ts","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0B,kBAAkB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/I,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAY,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,MAAM,EAAE,QAAQ,CAAC;IACjB,sDAAsD;IACtD,KAAK,EAAE,UAAU,CAAC;CACnB;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,+DAA+D;IAC/D,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;CACrC;AACD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,kDAAkD;IAClD,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,MAAM;IACvC,WAA2B,SAAS,IAAI,MAAM,CAA4B;IACnE,OAAO,EAAE,cAAc,CAAC;IAE/B,kFAAkF;gBACtE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;IAKvC,MAAM,IAAI,kBAAkB;IAM5C;;;;OAIG;IACH,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI;IAMtD;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAEzD;;;;OAIG;IACH,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAA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MultiAspect {
127
127
  const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;
128
128
  let elementId;
129
129
  let aspectId;
130
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
130
131
  iModelDb.withPreparedStatement(sql, (statement) => {
131
132
  statement.bindId("scope", scope);
132
133
  statement.bindString("kind", kind);
@@ -153,6 +154,7 @@ class ExternalSourceAspect extends ElementMultiAspect {
153
154
  static findAllBySource(iModelDb, scope, kind, identifier) {
154
155
  const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;
155
156
  const found = [];
157
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
156
158
  iModelDb.withPreparedStatement(sql, (statement) => {
157
159
  statement.bindId("scope", scope);
158
160
  statement.bindString("kind", kind);
@@ -1 +1 @@
1
- {"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AAC3D,gDAAoD;AA0BpD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAG1E,kFAAkF;IAClF,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,+DAA+D;IACzH,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,OAAO,GAAG,CAAC;I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O,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAtGD,oDAsGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,oCAApB,oBAAoB,QAcpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementAspects\n */\n\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\nimport { Entity } from \"./Entity\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\nimport { _verifyChannel } from \"./internal/Symbols\";\n\n/** Argument for the `ElementAspect.onXxx` static methods\n * @beta\n */\nexport interface OnAspectArg {\n /** The iModel for the aspect affected by this event. */\n iModel: IModelDb;\n /** The model for the aspect affected by this event */\n model: Id64String;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\n * @beta\n */\nexport interface OnAspectPropsArg extends OnAspectArg {\n /** The new properties of the aspect affected by this event. */\n props: Readonly<ElementAspectProps>;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\n * @beta\n */\nexport interface OnAspectIdArg extends OnAspectArg {\n /** The Id of the aspect affected by this event */\n aspectId: Id64String;\n}\n\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\n * @public\n */\nexport class ElementAspect extends Entity {\n public static override get className(): string { return \"ElementAspect\"; }\n public element: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ElementAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n\n public override toJSON(): ElementAspectProps {\n const val = super.toJSON() as ElementAspectProps;\n val.element = this.element;\n return val;\n }\n\n /** Called before a new ElementAspect is inserted.\n * @note throw an exception to disallow the insert\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInsert(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\n }\n\n /** Called after a new ElementAspect was inserted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInserted(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is updated.\n * @note throw an exception to disallow the update\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdate(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\n }\n\n /** Called after an ElementAspect was updated.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is deleted.\n * @note throw an exception to disallow the delete\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDelete(arg: OnAspectIdArg): void {\n const { aspectId, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n const { element } = iModel.elements.getAspect(aspectId);\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\n }\n\n /** Called after an ElementAspect was deleted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDeleted(_arg: OnAspectIdArg): void { }\n}\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\n * @public\n */\nexport class ElementUniqueAspect extends ElementAspect {\n public static override get className(): string { return \"ElementUniqueAspect\"; }\n}\n\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\n * @public\n */\nexport class ElementMultiAspect extends ElementAspect {\n public static override get className(): string { return \"ElementMultiAspect\"; }\n}\n\n/**\n * @public\n */\nexport class ChannelRootAspect extends ElementUniqueAspect {\n public static override get className(): string { return \"ChannelRootAspect\"; }\n /** Insert a ChannelRootAspect on the specified element.\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\n */\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\n iModel.elements.insertAspect(props);\n }\n}\n\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\n * @public\n */\nexport class ExternalSourceAspect extends ElementMultiAspect {\n public static override get className(): string { return \"ExternalSourceAspect\"; }\n\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n public scope: RelatedElement;\n /** The identifier of the object in the source repository. */\n public identifier: string;\n /** The kind of object within the source repository. */\n public kind: string;\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n public checksum?: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n public version?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n public jsonProperties?: string;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n public source?: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n this.source = RelatedElement.fromJSON(props.source);\n this.identifier = props.identifier;\n this.kind = props.kind;\n this.checksum = props.checksum;\n this.version = props.version;\n this.jsonProperties = props.jsonProperties;\n }\n\n /** @deprecated in 3.x. findAllBySource */\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\n let elementId: Id64String | undefined;\n let aspectId: Id64String | undefined;\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\n statement.bindId(\"scope\", scope);\n statement.bindString(\"kind\", kind);\n statement.bindString(\"identifier\", identifier);\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\n elementId = statement.getValue(0).getId();\n aspectId = statement.getValue(1).getId();\n }\n });\n return { elementId, aspectId };\n }\n\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\n * Therefore, the result array could have more than one entry with the same elementId.\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\n * @param iModelDb The iModel to query\n * @param scope The scope of the ExternalSourceAspects to find\n * @param kind The kind of the ExternalSourceAspects to find\n * @param identifier The identifier of the ExternalSourceAspects to find\n * @returns the query results\n */\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\n statement.bindId(\"scope\", scope);\n statement.bindString(\"kind\", kind);\n statement.bindString(\"identifier\", identifier);\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\n }\n });\n return found;\n }\n\n public override toJSON(): ExternalSourceAspectProps {\n const val = super.toJSON() as ExternalSourceAspectProps;\n val.scope = this.scope;\n val.source = this.source;\n val.identifier = this.identifier;\n val.kind = this.kind;\n val.checksum = this.checksum;\n val.version = this.version;\n val.jsonProperties = this.jsonProperties;\n return val;\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.scope)\n referenceIds.addElement(this.scope.id);\n referenceIds.addElement(this.element.id);\n if (this.source)\n referenceIds.addElement(this.source.id);\n }\n}\n\n/** @public */\nexport namespace ExternalSourceAspect {\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\n * @public\n */\n export enum Kind {\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\n Element = \"Element\",\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\n Relationship = \"Relationship\",\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\n * @see [[ExternalSourceAspect.scope]]\n */\n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AM,GAAG,GAAG,KAAK,CAAC,MAAM,EAA+B,CAAC;QACxD,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAxGD,oDAwGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,oCAApB,oBAAoB,QAcpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementAspects\n */\n\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\nimport { Entity } from \"./Entity\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\nimport { _verifyChannel } from \"./internal/Symbols\";\n\n/** Argument for the `ElementAspect.onXxx` static methods\n * @beta\n */\nexport interface OnAspectArg {\n /** The iModel for the aspect affected by this event. */\n iModel: IModelDb;\n /** The model for the aspect affected by this event */\n model: Id64String;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\n * @beta\n */\nexport interface OnAspectPropsArg extends OnAspectArg {\n /** The new properties of the aspect affected by this event. */\n props: Readonly<ElementAspectProps>;\n}\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\n * @beta\n */\nexport interface OnAspectIdArg extends OnAspectArg {\n /** The Id of the aspect affected by this event */\n aspectId: Id64String;\n}\n\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\n * @public\n */\nexport class ElementAspect extends Entity {\n public static override get className(): string { return \"ElementAspect\"; }\n public element: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ElementAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n\n public override toJSON(): ElementAspectProps {\n const val = super.toJSON() as ElementAspectProps;\n val.element = this.element;\n return val;\n }\n\n /** Called before a new ElementAspect is inserted.\n * @note throw an exception to disallow the insert\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInsert(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"insert aspect\");\n }\n\n /** Called after a new ElementAspect was inserted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onInserted(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is updated.\n * @note throw an exception to disallow the update\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdate(arg: OnAspectPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n iModel.locks.checkExclusiveLock(props.element.id, \"element\", \"update aspect\");\n }\n\n /** Called after an ElementAspect was updated.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\n\n /** Called before an ElementAspect is deleted.\n * @note throw an exception to disallow the delete\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDelete(arg: OnAspectIdArg): void {\n const { aspectId, iModel } = arg;\n iModel.channels[_verifyChannel](arg.model);\n const { element } = iModel.elements.getAspect(aspectId);\n iModel.locks.checkExclusiveLock(element.id, \"element\", \"delete aspect\");\n }\n\n /** Called after an ElementAspect was deleted.\n * @note If you override this method, you must call super.\n * @beta\n */\n protected static onDeleted(_arg: OnAspectIdArg): void { }\n}\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\n * @public\n */\nexport class ElementUniqueAspect extends ElementAspect {\n public static override get className(): string { return \"ElementUniqueAspect\"; }\n}\n\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\n * @public\n */\nexport class ElementMultiAspect extends ElementAspect {\n public static override get className(): string { return \"ElementMultiAspect\"; }\n}\n\n/**\n * @public\n */\nexport class ChannelRootAspect extends ElementUniqueAspect {\n public static override get className(): string { return \"ChannelRootAspect\"; }\n /** Insert a ChannelRootAspect on the specified element.\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\n */\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\n iModel.elements.insertAspect(props);\n }\n}\n\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\n * @public\n */\nexport class ExternalSourceAspect extends ElementMultiAspect {\n public static override get className(): string { return \"ExternalSourceAspect\"; }\n\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n public scope: RelatedElement;\n /** The identifier of the object in the source repository. */\n public identifier: string;\n /** The kind of object within the source repository. */\n public kind: string;\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n public checksum?: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n public version?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n public jsonProperties?: string;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n public source?: RelatedElement;\n\n /** Construct an aspect from its JSON representation and its containing iModel. */\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n this.source = RelatedElement.fromJSON(props.source);\n this.identifier = props.identifier;\n this.kind = props.kind;\n this.checksum = props.checksum;\n this.version = props.version;\n this.jsonProperties = props.jsonProperties;\n }\n\n /** @deprecated in 3.x. findAllBySource */\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\n let elementId: Id64String | undefined;\n let aspectId: Id64String | undefined;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\n statement.bindId(\"scope\", scope);\n statement.bindString(\"kind\", kind);\n statement.bindString(\"identifier\", identifier);\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\n elementId = statement.getValue(0).getId();\n aspectId = statement.getValue(1).getId();\n }\n });\n return { elementId, aspectId };\n }\n\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\n * Therefore, the result array could have more than one entry with the same elementId.\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\n * @param iModelDb The iModel to query\n * @param scope The scope of the ExternalSourceAspects to find\n * @param kind The kind of the ExternalSourceAspects to find\n * @param identifier The identifier of the ExternalSourceAspects to find\n * @returns the query results\n */\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\n statement.bindId(\"scope\", scope);\n statement.bindString(\"kind\", kind);\n statement.bindString(\"identifier\", identifier);\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\n }\n });\n return found;\n }\n\n public override toJSON(): ExternalSourceAspectProps {\n const val = super.toJSON() as ExternalSourceAspectProps;\n val.scope = this.scope;\n val.source = this.source;\n val.identifier = this.identifier;\n val.kind = this.kind;\n val.checksum = this.checksum;\n val.version = this.version;\n val.jsonProperties = this.jsonProperties;\n return val;\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.scope)\n referenceIds.addElement(this.scope.id);\n referenceIds.addElement(this.element.id);\n if (this.source)\n referenceIds.addElement(this.source.id);\n }\n}\n\n/** @public */\nexport namespace ExternalSourceAspect {\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\n * @public\n */\n export enum Kind {\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\n Element = \"Element\",\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\n Relationship = \"Relationship\",\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\n * @see [[ExternalSourceAspect.scope]]\n */\n Scope = \"Scope\",\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementTreeWalker.d.ts","sourceRoot":"","sources":["../../src/ElementTreeWalker.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAoB,SAAS,EAAE,UAAU,EAAoB,MAAM,qBAAqB,CAAC;AAIhG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAmB,KAAK,EAAE,MAAM,SAAS,CAAC;AAIjD,YAAY;AACZ,MAAM,WAAW,0BAA0B;IAAG,KAAK,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE;AA8CxF;;GAEG;AACH,qBAAa,sBAAsB;IACjC,SAAgB,UAAU,EAAE,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EAAE,KAAK,CAAC,EAAE,sBAAsB;IAKzF;;OAEG;IACI,4BAA4B;CAGpC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,MAAM,EAAE,QAAQ,CAAC;IACjB,wDAAwD;IACxD,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;AAClF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;AAyBrE;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,0BAA0B,GAAG,IAAI,CAIxH"}
@@ -32,6 +32,7 @@ function sortChildrenBeforeParents(iModel, ids) {
32
32
  return [...sortChildrenBeforeParents(iModel, children), parents];
33
33
  }
34
34
  function isModelEmpty(iModel, modelId) {
35
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
35
36
  return iModel.withPreparedStatement(`select count(*) from ${Element_1.Element.classFullName} where Model.Id = ?`, (stmt) => {
36
37
  stmt.bindId(1, modelId);
37
38
  stmt.step();
@@ -136,6 +137,7 @@ function logModel(op, iModel, modelId, scope, logElements) {
136
137
  const model = iModel.models.getModel(modelId);
137
138
  core_bentley_1.Logger.logTrace(loggerCategory, `${op} ${fmtModel(model)} ${scope ? scope.toString() : ""}`);
138
139
  if (logElements) {
140
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
139
141
  iModel.withPreparedStatement(`select ecinstanceid from ${Element_1.Element.classFullName} where Model.Id = ?`, (stmt) => {
140
142
  stmt.bindId(1, modelId);
141
143
  while (stmt.step() === core_bentley_1.DbResult.BE_SQLITE_ROW) {
@@ -194,6 +196,7 @@ class ElementTreeBottomUp {
194
196
  _processSubModel(model, parenScope) {
195
197
  const scope = new ElementTreeWalkerScope(parenScope, model);
196
198
  // Visit only the top-level parents. processElementTree will visit their children (bottom-up).
199
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
197
200
  model.iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {
198
201
  stmt.bindId(1, model.id);
199
202
  while (stmt.step() === core_bentley_1.DbResult.BE_SQLITE_ROW) {
@@ -345,6 +348,7 @@ class ElementTreeTopDown {
345
348
  _processSubModel(subModel, scope) {
346
349
  const subModelScope = new ElementTreeWalkerScope(scope, subModel);
347
350
  // Visit only the top-level parents. processElementTree will recurse into their children.
351
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
348
352
  this._iModel.withPreparedStatement(`select ECInstanceId from bis:Element where Model.id=? and Parent.Id is null`, (stmt) => {
349
353
  stmt.bindId(1, subModel.id);
350
354
  while (stmt.step() === core_bentley_1.DbResult.BE_SQLITE_ROW) {