type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(resolve) => { const postrc = this.nativeDb.postConcurrentQuery(ecsql, JSON.stringify(bindings, replacer), limit!, quota!, priority!); if (postrc.status !== PostStatus.Done) resolve({ status: QueryResponseStatus.PostError, rows: [] }); const poll = () => { const pollrc = this.n...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => { const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId); if (pollrc.status === PollStatus.Done) resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) }); else if (pollrc.status === PollStatus.Partial) resolve({ status: Quer...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => { poll(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(stmt: ECSqlStatement) => { if (bindings) stmt.bindValues(bindings); const rows: any[] = []; while (DbResult.BE_SQLITE_ROW === stmt.step()) { rows.push(stmt.getRow()); if (rows.length > IModelDb.maxLimit) { throw new IModelError(IModelStatus.BadRequest, "Max L...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => { if (stmt.isShared) this._sqliteStatementCache.release(stmt); else stmt.dispose(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(stmt) => { for (const row of stmt) { if (row.id !== undefined) { ids.add(row.id); if (ids.size > IModelDb.maxLimit) { throw new IModelError(IModelStatus.BadRequest, "Max LIMIT exceeded in SELECT statement", Logger.logError, loggerCategory); } } ...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => ({ schemaFileName })
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => iModelToken
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(baseClass) => this.forEachMetaData(iModel, baseClass, true, func, includeCustom)
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => ({ ...this._token, classFullName })
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(baseClassName: string) => this.loadMetaData(baseClassName)
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(resolve, reject) => { request!.doSnap(this.nativeDb, JsonUtils.toObject(props), (ret: IModelJsNative.ErrorStatusOrResult<IModelStatus, SnapResponseProps>) => { this._snaps.delete(sessionId); if (ret.error !== undefined) reject(new Error(ret.error.message)); else ...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(ret: IModelJsNative.ErrorStatusOrResult<IModelStatus, SnapResponseProps>) => { this._snaps.delete(sessionId); if (ret.error !== undefined) reject(new Error(ret.error.message)); else resolve(ret.result); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(id) => { const props = this.getModelProps(id); const jsClass = this._iModel.getJsClass<typeof Model>(props.classFullName); if (IModelStatus.Success !== jsClass.onDelete(props)) return; const error = this._iModel.nativeDb.deleteModel(id); if (error !== IModelSt...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(stmt: ECSqlStatement) => { stmt.bindId(1, code.spec); stmt.bindId(2, Id64.fromString(code.scope)); stmt.bindString(3, code.value!); if (DbResult.BE_SQLITE_ROW !== stmt.step()) return undefined; return Id64.fromJSON(stmt.getRow().id); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(id) => { const props = this.getElementProps(id); const jsClass = iModel.getJsClass<typeof Element>(props.classFullName); if (IModelStatus.Success !== jsClass.onDelete(props, iModel)) return; const error = iModel.nativeDb.deleteElement(id); if (error !== IModel...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => ({ aspectInstanceId, aspectClassName })
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(id) => { const status = this._iModel.nativeDb.deleteElementAspect(id); if (status !== IModelStatus.Success) throw new IModelError(status, "Error deleting ElementAspect", Logger.logWarning, loggerCategory); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(id) => { try { props.push(imodel.elements.getElementProps<ViewDefinitionProps>(id)); } catch (err) { } }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(resolve, reject) => { requestContext.enter(); this._iModel.nativeDb.getTileTree(id, (ret: IModelJsNative.ErrorStatusOrResult<IModelStatus, any>) => { if (undefined !== ret.error) reject(new IModelError(ret.error.status, "TreeId=" + id)); else resolve(r...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(ret: IModelJsNative.ErrorStatusOrResult<IModelStatus, any>) => { if (undefined !== ret.error) reject(new IModelError(ret.error.status, "TreeId=" + id)); else resolve(ret.result! as TileTreeProps); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => ({ tileSize, tileSizeThreshold, treeId, tileId, iModelGuid })
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => ({ loadTime, loadTimeThreshold, treeId, tileId, iModelGuid })
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
() => this.pollTileContent(resolve, reject, treeId, tileId, requestContext)
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ArrowFunction
(resolve, reject) => { this.pollTileContent(resolve, reject, treeId, tileId, requestContext); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ClassDeclaration
/** Parameters to open an IModelDb * @public */ export class OpenParams { // Constructor public constructor( /** Mode to Open the IModelDb */ public readonly openMode: OpenMode, /** Operations allowed when synchronizing changes between the IModelDb and IModelHub */ public readonly syncMo...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ClassDeclaration
/** The collection of models in an [[IModelDb]]. * @public */ export class Models { /** @internal */ public constructor(private _iModel: IModelDb) { } /** Get the Model with the specified identifier. * @param modelId The Model identifier. * @throws [[IModelError]] */ publ...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ClassDeclaration
/** The collection of views in an [[IModelDb]]. * @public */ export class Views { /** @internal */ public constructor(private _iModel: IModelDb) { } /** Query for the array of ViewDefinitionProps of the specified class and matching the specified IsPrivate setting. * @param className Query...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
ClassDeclaration
/** @internal */ export class Tiles { /** @internal */ public constructor(private _iModel: IModelDb) { } /** @internal */ public async requestTileTreeProps(requestContext: ClientRequestContext, id: string): Promise<TileTreeProps> { requestContext.enter(); if (!this._iModel.briefcase)...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
InterfaceDeclaration
/** An error generated during dependency validation. * @beta */ export interface ValidationError { /** If true, txn is aborted. */ fatal: boolean; /** The type of error. */ errorType: string; /** Optional description of what went wrong. */ message?: string; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
EnumDeclaration
/** Operations allowed when synchronizing changes between the IModelDb and the iModel Hub * @public */ export enum SyncMode { FixedVersion = 1, PullAndPush = 2 }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
EnumDeclaration
/** Represents the current state of a pollable tile content request. * Note: lack of a "completed" state because polling a completed request returns the content as a Uint8Array. * @internal */ export enum TileContentState { New, // Request was just created and enqueued. Pending, // Request is enqu...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
EnumDeclaration
/** @public */ export enum TxnAction { None = 0, Commit = 1, Abandon = 2, Reverse = 3, Reinstate = 4, Merge = 5 }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
TypeAliasDeclaration
/** A string that identifies a Txn. * @public */ export type TxnIdString = string;
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
TypeAliasDeclaration
/** The signature of a function that can supply a description of local Txns in the specified briefcase up to and including the specified endTxnId. * @public */ export type ChangeSetDescriber = (endTxnId: TxnIdString) => string;
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private validate() { if (this.isStandalone && this.syncMode !== undefined) throw new IModelError(BentleyStatus.ERROR, "Invalid parameters - only openMode can be defined if opening a standalone Db"); if (this.openMode === OpenMode.Readonly && this.syncMode === SyncMode.PullAndPush) { throw new...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create parameters to open the Db as of a fixed version in a readonly mode */ public static fixedVersion(): OpenParams { return new OpenParams(OpenMode.Readonly, SyncMode.FixedVersion); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create parameters to open the Db to make edits and push changes to the Hub */ public static pullAndPush(): OpenParams { return new OpenParams(OpenMode.ReadWrite, SyncMode.PullAndPush); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create parameters to open a standalone Db * @deprecated The confusing concept of *standalone* is being replaced by the more strict concept of a read-only iModel *snapshot*. */ public static standalone(openMode: OpenMode) { return new OpenParams(openMode); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Returns true if equal and false otherwise */ public equals(other: OpenParams) { return other.openMode === this.openMode && other.syncMode === this.syncMode; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
public readFontJson(): string { return this.nativeDb.readFontMap(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
public embedFont(prop: FontProps): FontProps { this._fontMap = undefined; return JSON.parse(this.nativeDb.embedFont(JSON.stringify(prop))) as FontProps; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private initializeIModelDb() { const props = JSON.parse(this.nativeDb.getIModelProps()) as IModelProps; const name = props.rootSubject ? props.rootSubject.name : path.basename(this.briefcase.pathname); super.initialize(name, props); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private static constructIModelDb(briefcaseEntry: BriefcaseEntry, openParams: OpenParams, contextId?: string): IModelDb { if (briefcaseEntry.iModelDb) return briefcaseEntry.iModelDb; // If there's an IModelDb already associated with the briefcase, that should be reused. const iModelToken = new IModelTo...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create an *empty* local iModel *snapshot* file. Snapshots are disconnected from iModelHub so do not have a change timeline. Snapshots are typically used for archival or data transfer purposes. * > Note: A *snapshot* cannot be modified after [[closeSnapshot]] is called. * @param snapshotFile The file that wi...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create a local iModel *snapshot* file using this iModel as a *seed* or starting point. * Snapshots are disconnected from iModelHub so do not have a change timeline. Snapshots are typically used for archival or data transfer purposes. * > Note: A *snapshot* cannot be modified after [[closeSnapshot]] is calle...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Create an iModel on iModelHub */ public static async create(requestContext: AuthorizedClientRequestContext, contextId: string, iModelName: string, args: CreateIModelProps): Promise<IModelDb> { requestContext.enter(); IModelDb.onCreate.raiseEvent(requestContext, contextId, args); const iModelId: strin...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Open an iModel from a local file. * @param pathname The pathname of the iModel * @param openMode Open mode for database * @param enableTransactions Enable tracking of transactions in this standalone iModel * @throws [[IModelError]] * @see [[open]], [[openSnapshot]] * @deprecated iModelHub ma...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Open a local iModel *snapshot*. Once created, *snapshots* are read-only and are typically used for archival or data transfer purposes. * @see [[open]] * @throws [IModelError]($common) If the file is not found or is not a valid *snapshot*. * @beta */ public static openSnapshot(filePath: string): IMod...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Open an iModel from iModelHub. IModelDb files are cached locally. The requested version may be downloaded from iModelHub to the * cache, or a previously downloaded version re-used from the cache - this behavior can optionally be configured through OpenParams. * Every open call must be matched with a call to...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Close this standalone iModel, if it is currently open * @throws IModelError if the iModel is not open, or is not standalone * @see [[closeSnapshot]] * @deprecated The confusing concept of *standalone* is being replaced by the more strict concept of a read-only iModel *snapshot*. Callers should migrate t...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Close this local read-only iModel *snapshot*, if it is currently open. * > Note: A *snapshot* cannot be modified after this function is called. * @throws IModelError if the iModel is not open, or is not a *snapshot*. * @beta */ public closeSnapshot(): void { this.closeStandalone(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Close this iModel, if it is currently open. * @param requestContext The client request context. * @param keepBriefcase Hint to discard or keep the briefcase for potential future use. * @throws IModelError if the iModel is not open, or is really a snapshot iModel */ public async close(requestContext:...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private forwardChangesetApplied() { this.onChangesetApplied.raiseEvent(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private setupBriefcaseEntry(briefcaseEntry: BriefcaseEntry) { briefcaseEntry.iModelDb = this; briefcaseEntry.onBeforeClose.addListener(this.onBriefcaseCloseHandler, this); briefcaseEntry.onBeforeVersionUpdate.addListener(this.onBriefcaseVersionUpdatedHandler, this); briefcaseEntry.onChangesetApplie...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private clearBriefcaseEntry(): void { const briefcaseEntry = this.briefcase; briefcaseEntry.onBeforeClose.removeListener(this.onBriefcaseCloseHandler, this); briefcaseEntry.onBeforeVersionUpdate.removeListener(this.onBriefcaseVersionUpdatedHandler, this); briefcaseEntry.onChangesetApplied.removeLis...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private onBriefcaseCloseHandler() { this.onBeforeClose.raiseEvent(); this.clearStatementCache(); this.clearSqliteStatementCache(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
private onBriefcaseVersionUpdatedHandler() { this.iModelToken.changeSetId = this.briefcase.currentChangeSetId; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get the briefcase Id of this iModel */ public getBriefcaseId(): BriefcaseId { return new BriefcaseId(this.briefcase === undefined ? BriefcaseId.Illegal : this.briefcase.briefcaseId); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Returns a new IModelError with errorNumber, message, and meta-data set properly for a *not open* error. * @internal */ public newNotOpenError() { return new IModelError(IModelStatus.NotOpen, "IModelDb not open", Logger.logError, loggerCategory, () => ({ name: this.name, ...this.iModelToken })); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get a prepared ECSQL statement - may require preparing the statement, if not found in the cache. * @param ecsql The ECSQL statement to prepare * @returns the prepared statement * @throws IModelError if the statement cannot be prepared. Normally, prepare fails due to ECSQL syntax errors or references to ...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Use a prepared ECSQL statement. This function takes care of preparing the statement and then releasing it. * * As preparing statements can be costly, they get cached. When calling this method again with the same ECSQL, * the already prepared statement from the cache will be reused. * * See also:...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Compute number of rows that would be returned by the ECSQL. * * See also: * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) * * @param ecsql The ECSQL statement to execute * @param bindings The values to bind to the ...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Execute a query against this ECDb but restricted by quota and limit settings. This is intended to be used internally * The result of the query is returned as an array of JavaScript objects where every array element represents an * [ECSQL row]($docs/learning/ECSQLRowFormat). * * See also: * - [EC...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Execute a query and stream its results * The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. * [ECSQL row]($docs/learning/ECSQLRowFormat). * * See also: * - [ECSQL Overview]($docs/learning/backend/Executi...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Execute a query against this IModelDb. * The result of the query is returned as an array of JavaScript objects where every array element represents an * [ECSQL row]($docs/learning/ECSQLRowFormat). * * See also: * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) * - [Code Examples]($...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Use a prepared SQLite SQL statement. This function takes care of preparing the statement and then releasing it. * As preparing statements can be costly, they get cached. When calling this method again with the same ECSQL, * the already prepared statement from the cache will be reused. * @param sql The S...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Prepare an SQLite SQL statement. * @param sql The SQLite SQL statement to prepare * @throws [[IModelError]] if there is a problem preparing the statement. * @internal */ public prepareSqliteStatement(sql: string): SqliteStatement { const stmt = new SqliteStatement(); stmt.prepare(this.brie...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get a prepared SQLite SQL statement - may require preparing the statement, if not found in the cache. * @param sql The SQLite SQL statement to prepare * @returns the prepared statement * @throws IModelError if the statement cannot be prepared. Normally, prepare fails due to SQL syntax errors or referenc...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Query for a set of entity ids, given an EntityQueryParams * @param params The query parameters. The `limit` and `offset` members should be used to page results. * @returns an Id64Set with results of query * @throws [IModelError]($common) if the generated statement is invalid or [IModelDb.maxLimit]($back...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Empty the [ECSqlStatementCache]($backend) for this iModel. */ public clearStatementCache(): void { this._statementCache.clear(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Empty the [SqliteStatementCache]($backend) for this iModel. */ public clearSqliteStatementCache(): void { this._sqliteStatementCache.clear(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get the GUID of this iModel. */ public getGuid(): GuidString { return this.nativeDb.getDbGuid(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Set the GUID of this iModel. */ public setGuid(guid: GuidString): DbResult { return this.nativeDb.setDbGuid(guid); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Update the project extents for this iModel. * <p><em>Example:</em> * ``` ts * [[include:IModelDb.updateProjectExtents]] * ``` */ public updateProjectExtents(newExtents: AxisAlignedBox3d) { this.projectExtents = newExtents; this.updateIModelProps(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Update the [EcefLocation]($docs/learning/glossary#eceflocation) of this iModel. */ public updateEcefLocation(ecef: EcefLocation) { this.setEcefLocation(ecef); this.updateIModelProps(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Update the IModelProps of this iModel in the database. */ public updateIModelProps() { this.nativeDb.updateIModelProps(JSON.stringify(this.toJSON())); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** * Commit pending changes to this iModel. * @note If this IModelDb is connected to an iModel, then you must call [[ConcurrencyControl.request]] before attempting to save changes. * @param _description Optional description of the changes * @throws [[IModelError]] if there is a problem saving changes o...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Abandon pending changes in this iModel */ public abandonChanges() { this.concurrencyControl.abandonRequest(); this.nativeDb.abandonChanges(); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Pull and Merge changes from iModelHub * @param requestContext The client request context. * @param version Version to pull and merge to. * @throws [[IModelError]] If the pull and merge fails. * @beta */ public async pullAndMergeChanges(requestContext: AuthorizedClientRequestContext, version: IMo...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Push changes to iModelHub * @param requestContext The client request context. * @param describer A function that returns a description of the changeset. Defaults to the combination of the descriptions of all local Txns. * @throws [[IModelError]] If the pull and merge fails. * @beta */ public asy...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Reverse a previously merged set of changes * @param requestContext The client request context. * @param version Version to reverse changes to. * @throws [[IModelError]] If the reversal fails. * @beta */ public async reverseChanges(requestContext: AuthorizedClientRequestContext, version: IModelVe...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Reinstate a previously reversed set of changes * @param requestContext The client request context. * @param version Version to reinstate changes to. * @throws [[IModelError]] If the reinstate fails. * @beta */ public async reinstateChanges(requestContext: AuthorizedClientRequestContext, version:...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Set iModel as Master copy. * @param guid Optionally provide db guid. If its not provided the method would generate one. */ public setAsMaster(guid?: GuidString): void { if (guid === undefined) { if (DbResult.BE_SQLITE_OK !== this.nativeDb.setAsMaster()) throw new IModelError(IModelStatu...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Import an ECSchema. On success, the schema definition is stored in the iModel. * This method is asynchronous (must be awaited) because, in the case where this IModelId is a briefcase, * this method must first obtain the schema lock from the IModel server. * You must import a schema into an iModel before...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Find an already open IModelDb. Used by the remoting logic. * @throws [[IModelError]] if an open IModelDb matching the token is not found. */ public static find(iModelToken: IModelToken): IModelDb { const briefcaseEntry = BriefcaseManager.findBriefcaseByToken(iModelToken); if (!briefcaseEntry || !b...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** @internal */ public insertCodeSpec(codeSpec: CodeSpec): Id64String { if (!this.briefcase) throw this.newNotOpenError(); const { error, result } = this.nativeDb.insertCodeSpec(codeSpec.name, codeSpec.specScopeType, codeSpec.scopeReq); if (error) throw new IModelError(error.status, "inserting CodeSpec"...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Prepare an ECSQL statement. * @param sql The ECSQL statement to prepare * @throws [[IModelError]] if there is a problem preparing the statement. */ public prepareStatement(sql: string): ECSqlStatement { if (!this.briefcase) throw this.newNotOpenError(); const stmt = new ECSqlStatement()...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Construct an entity (Element or Model) from an iModel. * @throws [[IModelError]] if the entity cannot be constructed. */ public constructEntity<T extends Entity>(props: EntityProps): T { const jsClass = this.getJsClass(props.classFullName); return new jsClass(props, this) as T; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get the JavaScript class that handles a given entity class. */ public getJsClass<T extends typeof Entity>(classFullName: string): T { try { return ClassRegistry.getClass(classFullName, this) as T; } catch (err) { if (!ClassRegistry.isNotFoundError(err)) { Logger.logError(loggerCate...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary. * @throws [IModelError]($common) if the metadata cannot be found nor loaded. */ public getMetaData(classFullName: string): EntityMetaData { let metadata = this.classMetaDataRegist...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** * Invoke a callback on each property of the specified class, optionally including superclass properties. * @param iModel The IModel that contains the schema * @param classFullName The full class name to load the metadata, if necessary * @param wantSuper If true, superclass properties will also be p...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/*** @internal */ private loadMetaData(classFullName: string) { if (this.classMetaDataRegistry.find(classFullName)) return; const className = classFullName.split(":"); if (className.length !== 2) throw new IModelError(IModelStatus.BadArg, "Invalid classFullName", Logger.logError, loggerCa...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Query if this iModel contains the definition of the specified class. * @param classFullName The full name of the class, for example, SomeSchema:SomeClass * @returns true if the iModel contains the class definition or false if not. * @see importSchema */ public containsClass(classFullName: string): b...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Query a "file property" from this iModel, as a string. * @returns the property string or undefined if the property is not present. */ public queryFilePropertyString(prop: FilePropertyProps): string | undefined { return this.nativeDb.queryFileProperty(JSON.stringify(prop), true) as string | undefined; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Query a "file property" from this iModel, as a blob. * @returns the property blob or undefined if the property is not present. */ public queryFilePropertyBlob(prop: FilePropertyProps): Uint8Array | undefined { return this.nativeDb.queryFileProperty(JSON.stringify(prop), false) as Uint8Array | undefined; }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Save a "file property" to this iModel * @param prop the FilePropertyProps that describes the new property * @param value either a string or a blob to save as the file property * @returns 0 if successful, status otherwise */ public saveFileProperty(prop: FilePropertyProps, strValue: string | undefine...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** delete a "file property" from this iModel * @param prop the FilePropertyProps that describes the property * @returns 0 if successful, status otherwise */ public deleteFileProperty(prop: FilePropertyProps): DbResult { return this.nativeDb.saveFileProperty(JSON.stringify(prop), undefined, undefined); }
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
/** Query for the next available major id for a "file property" from this iModel. * @param prop the FilePropertyProps that describes the property * @returns the next available (that is, an unused) id for prop. If none are present, will return 0. */ public queryNextAvailableFileProperty(prop: FilePropertyPro...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript
MethodDeclaration
public async requestSnap(requestContext: ClientRequestContext, sessionId: string, props: SnapRequestProps): Promise<SnapResponseProps> { requestContext.enter(); let request = this._snaps.get(sessionId); if (undefined === request) { request = new IModelHost.platform.SnapRequest(); this._sna...
Ranjith-K-Soman/imodeljs
core/backend/src/IModelDb.ts
TypeScript