@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.
- package/CHANGELOG.md +42 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +2 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +12 -5
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +1 -0
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +2 -0
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +46 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +90 -0
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +200 -2
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +237 -5
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +2 -0
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +4 -0
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +13 -1
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +41 -5
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +1 -1
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +3 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +2 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +2 -0
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/rpc/multipart.d.ts.map +1 -1
- package/lib/cjs/rpc/multipart.js +2 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/web/request.d.ts.map +1 -1
- package/lib/cjs/rpc/web/request.js +2 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +3 -2
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/package.json +18 -15
package/lib/cjs/ECDb.js
CHANGED
|
@@ -39,6 +39,7 @@ class ECDb {
|
|
|
39
39
|
this._sqliteStatementCache = new SqliteStatement_1.StatementCache(size);
|
|
40
40
|
}
|
|
41
41
|
constructor() {
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
42
43
|
this._statementCache = new SqliteStatement_1.StatementCache();
|
|
43
44
|
this._sqliteStatementCache = new SqliteStatement_1.StatementCache();
|
|
44
45
|
this._nativeDb = new NativePlatform_1.IModelNative.platform.ECDb();
|
|
@@ -131,6 +132,77 @@ class ECDb {
|
|
|
131
132
|
getSchemaProps(name) {
|
|
132
133
|
return this[Symbols_1._nativeDb].getSchemaProps(name);
|
|
133
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Use a prepared ECSQL statement, potentially from the statement cache. If the requested statement doesn't exist
|
|
137
|
+
* in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved
|
|
138
|
+
* in the statement cache so it can be reused in the future. Use this method for ECSQL statements that will be
|
|
139
|
+
* reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding
|
|
140
|
+
* the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withStatement]].
|
|
141
|
+
* @param sql The SQLite SQL statement to execute
|
|
142
|
+
* @param callback the callback to invoke on the prepared statement
|
|
143
|
+
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
144
|
+
* @returns the value returned by `callback`.
|
|
145
|
+
* @see [[withWriteStatement]]
|
|
146
|
+
* @beta
|
|
147
|
+
*/
|
|
148
|
+
withCachedWriteStatement(ecsql, callback, logErrors = true) {
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
150
|
+
const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);
|
|
151
|
+
const release = () => this._statementCache.addOrDispose(stmt);
|
|
152
|
+
try {
|
|
153
|
+
const val = callback(new ECSqlStatement_1.ECSqlWriteStatement(stmt));
|
|
154
|
+
if (val instanceof Promise) {
|
|
155
|
+
val.then(release, release);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
release();
|
|
159
|
+
}
|
|
160
|
+
return val;
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
release();
|
|
164
|
+
throw err;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Prepared and execute a callback on an ECSQL statement. After the callback completes the statement is disposed.
|
|
169
|
+
* Use this method for ECSQL statements are either not expected to be reused, or are not expensive to prepare.
|
|
170
|
+
* For statements that will be reused often, instead use [[withPreparedStatement]].
|
|
171
|
+
* @param sql The SQLite SQL statement to execute
|
|
172
|
+
* @param callback the callback to invoke on the prepared statement
|
|
173
|
+
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
174
|
+
* @returns the value returned by `callback`.
|
|
175
|
+
* @see [[withCachedWriteStatement]]
|
|
176
|
+
* @beta
|
|
177
|
+
*/
|
|
178
|
+
withWriteStatement(ecsql, callback, logErrors = true) {
|
|
179
|
+
const stmt = this.prepareWriteStatement(ecsql, logErrors);
|
|
180
|
+
const release = () => stmt.dispose();
|
|
181
|
+
try {
|
|
182
|
+
const val = callback(stmt);
|
|
183
|
+
if (val instanceof Promise) {
|
|
184
|
+
val.then(release, release);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
release();
|
|
188
|
+
}
|
|
189
|
+
return val;
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
release();
|
|
193
|
+
throw err;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** Prepare an ECSQL statement.
|
|
197
|
+
* @param ecsql The ECSQL statement to prepare
|
|
198
|
+
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
199
|
+
* @throws [IModelError]($common) if there is a problem preparing the statement.
|
|
200
|
+
* @beta
|
|
201
|
+
*/
|
|
202
|
+
prepareWriteStatement(ecsql, logErrors = true) {
|
|
203
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
204
|
+
return new ECSqlStatement_1.ECSqlWriteStatement(this.prepareStatement(ecsql, logErrors));
|
|
205
|
+
}
|
|
134
206
|
/**
|
|
135
207
|
* Use a prepared ECSQL statement, potentially from the statement cache. If the requested statement doesn't exist
|
|
136
208
|
* in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved
|
|
@@ -143,8 +215,14 @@ class ECDb {
|
|
|
143
215
|
* @returns the value returned by `callback`.
|
|
144
216
|
* @see [[withStatement]]
|
|
145
217
|
* @public
|
|
218
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
219
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
220
|
+
* [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.
|
|
221
|
+
* Mean while use [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
146
222
|
*/
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
147
224
|
withPreparedStatement(ecsql, callback, logErrors = true) {
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
148
226
|
const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);
|
|
149
227
|
const release = () => this._statementCache.addOrDispose(stmt);
|
|
150
228
|
try {
|
|
@@ -172,8 +250,14 @@ class ECDb {
|
|
|
172
250
|
* @returns the value returned by `callback`.
|
|
173
251
|
* @see [[withPreparedStatement]]
|
|
174
252
|
* @public
|
|
253
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
254
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
255
|
+
* [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.
|
|
256
|
+
* Mean while use [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
175
257
|
*/
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
176
259
|
withStatement(ecsql, callback, logErrors = true) {
|
|
260
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
177
261
|
const stmt = this.prepareStatement(ecsql, logErrors);
|
|
178
262
|
const release = () => stmt.dispose();
|
|
179
263
|
try {
|
|
@@ -195,8 +279,14 @@ class ECDb {
|
|
|
195
279
|
* @param ecsql The ECSQL statement to prepare
|
|
196
280
|
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
197
281
|
* @throws [IModelError]($common) if there is a problem preparing the statement.
|
|
282
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
283
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
284
|
+
* [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.
|
|
285
|
+
* Mean while use [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
198
286
|
*/
|
|
287
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
199
288
|
prepareStatement(ecsql, logErrors = true) {
|
|
289
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
200
290
|
const stmt = new ECSqlStatement_1.ECSqlStatement();
|
|
201
291
|
stmt.prepare(this[Symbols_1._nativeDb], ecsql, logErrors);
|
|
202
292
|
return stmt;
|
package/lib/cjs/ECDb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECDb.js","sourceRoot":"","sources":["../../src/ECDb.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAsF;AAEtF,oDAA6I;AAC7I,mEAAgE;AAChE,uDAAoD;AACpD,qDAAkD;AAClD,8DAAyD;AACzD,uDAAoE;AACpE,gDAA+C;AAE/C,MAAM,cAAc,GAAW,6CAAqB,CAAC,IAAI,CAAC;AAE1D;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uDAAQ,CAAA;IACR,yDAAS,CAAA;IACT,sGAAsG;IACtG,6DAAW,CAAA;AACb,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;GAEG;AACH,MAAa,IAAI;IAKf;;OAEG;IACI,gBAAgB,CAAC,IAAY;QAClC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,qBAAqB,GAAG,IAAI,gCAAc,CAAkB,IAAI,CAAC,CAAC;IACzE,CAAC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AC,OAAO,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;YACpI,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAlWD,oBAkWC","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 ECDb\n */\nimport { assert, DbResult, IDisposable, Logger, OpenMode } from \"@itwin/core-bentley\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { DbQueryRequest, ECSchemaProps, ECSqlReader, IModelError, QueryBinder, QueryOptions, QueryOptionsBuilder } from \"@itwin/core-common\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { ConcurrentQuery } from \"./ConcurrentQuery\";\nimport { ECSqlStatement } from \"./ECSqlStatement\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { SqliteStatement, StatementCache } from \"./SqliteStatement\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\nconst loggerCategory: string = BackendLoggerCategory.ECDb;\n\n/** Modes for how to open [ECDb]($backend) files.\n * @public\n */\nexport enum ECDbOpenMode {\n Readonly,\n ReadWrite,\n /** Opens the file read-write and upgrades the file if necessary to the latest file format version. */\n FileUpgrade,\n}\n\n/** An ECDb file\n * @public\n */\nexport class ECDb implements IDisposable {\n private _nativeDb?: IModelJsNative.ECDb;\n private readonly _statementCache = new StatementCache<ECSqlStatement>();\n private _sqliteStatementCache = new StatementCache<SqliteStatement>();\n\n /** only for tests\n * @internal\n */\n public resetSqliteCache(size: number) {\n this._sqliteStatementCache.clear();\n this._sqliteStatementCache = new StatementCache<SqliteStatement>(size);\n }\n\n constructor() {\n this._nativeDb = new IModelNative.platform.ECDb();\n }\n /** Call this function when finished with this ECDb object. This releases the native resources held by the\n * ECDb object.\n */\n public dispose(): void {\n if (!this._nativeDb)\n return;\n\n this.closeDb();\n this._nativeDb.dispose();\n this._nativeDb = undefined;\n }\n\n /** Create an ECDb\n * @param pathName The path to the ECDb file to create.\n * @throws [IModelError]($common) if the operation failed.\n */\n public createDb(pathName: string): void {\n const status: DbResult = this[_nativeDb].createDb(pathName);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to created ECDb\");\n }\n\n /** Open the ECDb.\n * @param pathName The path to the ECDb file to open\n * @param openMode Open mode\n * @throws [IModelError]($common) if the operation failed.\n */\n public openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): void {\n const nativeOpenMode: OpenMode = openMode === ECDbOpenMode.Readonly ? OpenMode.Readonly : OpenMode.ReadWrite;\n const tryUpgrade: boolean = openMode === ECDbOpenMode.FileUpgrade;\n const status: DbResult = this[_nativeDb].openDb(pathName, nativeOpenMode, tryUpgrade);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to open ECDb\");\n }\n\n /** Returns true if the ECDb is open */\n public get isOpen(): boolean { return this[_nativeDb].isOpen(); }\n\n /** Close the Db after saving any uncommitted changes.\n * @throws [IModelError]($common) if the database is not open.\n */\n public closeDb(): void {\n this._statementCache.clear();\n this._sqliteStatementCache.clear();\n this[_nativeDb].closeDb();\n }\n\n /** @internal use to test statement caching */\n public clearStatementCache() {\n this._statementCache.clear();\n }\n\n /** @internal use to test statement caching */\n public getCachedStatementCount() {\n return this._statementCache.size;\n }\n\n /** Commit the outermost transaction, writing changes to the file. Then, restart the transaction.\n * @param changesetName The name of the operation that generated these changes.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public saveChanges(changesetName?: string): void {\n const status: DbResult = this[_nativeDb].saveChanges(changesetName);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to save changes\");\n }\n\n /** Abandon (cancel) the outermost transaction, discarding all changes since last save. Then, restart the transaction.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public abandonChanges(): void {\n const status: DbResult = this[_nativeDb].abandonChanges();\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to abandon changes\");\n }\n\n /** Import a schema.\n *\n * If the import was successful, the database is automatically saved to disk.\n * @param pathName Path to ECSchema XML file to import.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public importSchema(pathName: string): void {\n const status: DbResult = this[_nativeDb].importSchema(pathName);\n if (status !== DbResult.BE_SQLITE_OK) {\n Logger.logError(loggerCategory, `Failed to import schema from '${pathName}'.`);\n throw new IModelError(status, `Failed to import schema from '${pathName}'.`);\n }\n }\n\n /**\n * Returns the full schema for the input name.\n * @param name The name of the schema e.g. 'ECDbMeta'\n * @returns The SchemaProps for the requested schema\n * @throws if the schema can not be found or loaded.\n */\n public getSchemaProps(name: string): ECSchemaProps {\n return this[_nativeDb].getSchemaProps(name);\n }\n\n /**\n * Use a prepared ECSQL statement, potentially from the statement cache. If the requested statement doesn't exist\n * in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved\n * in the statement cache so it can be reused in the future. Use this method for ECSQL statements that will be\n * reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding\n * the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withStatement]]\n * @public\n */\n public withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors = true): T {\n const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);\n const release = () => this._statementCache.addOrDispose(stmt);\n try {\n const val = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /**\n * Prepared and execute a callback on an ECSQL statement. After the callback completes the statement is disposed.\n * Use this method for ECSQL statements are either not expected to be reused, or are not expensive to prepare.\n * For statements that will be reused often, instead use [[withPreparedStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withPreparedStatement]]\n * @public\n */\n public withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors = true): T {\n const stmt = this.prepareStatement(ecsql, logErrors);\n const release = () => stmt.dispose();\n try {\n const val = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /** Prepare an ECSQL statement.\n * @param ecsql The ECSQL statement to prepare\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @throws [IModelError]($common) if there is a problem preparing the statement.\n */\n public prepareStatement(ecsql: string, logErrors = true): ECSqlStatement {\n const stmt = new ECSqlStatement();\n stmt.prepare(this[_nativeDb], ecsql, logErrors);\n return stmt;\n }\n\n /**\n * Use a prepared SQL statement, potentially from the statement cache. If the requested statement doesn't exist\n * in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved\n * in the statement cache so it can be reused in the future. Use this method for SQL statements that will be\n * reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding\n * the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withSqliteStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withPreparedStatement]]\n * @public\n */\n public withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors = true): T {\n const stmt = this._sqliteStatementCache.findAndRemove(sql) ?? this.prepareSqliteStatement(sql, logErrors);\n const release = () => this._sqliteStatementCache.addOrDispose(stmt);\n try {\n const val: T = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /**\n * Prepared and execute a callback on a SQL statement. After the callback completes the statement is disposed.\n * Use this method for SQL statements are either not expected to be reused, or are not expensive to prepare.\n * For statements that will be reused often, instead use [[withPreparedSqliteStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @public\n */\n public withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors = true): T {\n const stmt = this.prepareSqliteStatement(sql, logErrors);\n const release = () => stmt.dispose();\n try {\n const val: T = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /** Prepare an SQL statement.\n * @param sql The SQLite SQL statement to prepare\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @throws [IModelError]($common) if there is a problem preparing the statement.\n * @internal\n */\n public prepareSqliteStatement(sql: string, logErrors = true): SqliteStatement {\n const stmt = new SqliteStatement(sql);\n stmt.prepare(this[_nativeDb], logErrors);\n return stmt;\n }\n\n /** @internal\n * @deprecated in 4.8. This internal API will be removed in 5.0. Use ECDb's public API instead.\n */\n public get nativeDb(): IModelJsNative.ECDb { return this[_nativeDb]; }\n\n /** @internal */\n public get [_nativeDb](): IModelJsNative.ECDb {\n assert(undefined !== this._nativeDb);\n return this._nativeDb;\n }\n\n /** Allow to execute query and read results along with meta data. The result are streamed.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n * - [ECSQL Row Format]($docs/learning/ECSQLRowFormat)\n *\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param config Allow to specify certain flags which control how query is executed.\n * @returns Returns an [ECSqlReader]($common) which helps iterate over the result set and also give access to metadata.\n * @public\n * */\n public createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader {\n if (!this._nativeDb || !this._nativeDb.isOpen()) {\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"db not open\");\n }\n const executor = {\n execute: async (request: DbQueryRequest) => {\n return ConcurrentQuery.executeQueryRequest(this[_nativeDb], request);\n },\n };\n return new ECSqlReader(executor, ecsql, params, config);\n }\n\n /** Execute a query and stream its results\n * 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.\n * [ECSQL row]($docs/learning/ECSQLRowFormat).\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param options Allow to specify certain flags which control how query is executed.\n * @returns Returns the query result as an *AsyncIterableIterator<any>* which lazy load result as needed. The row format is determined by *rowFormat* parameter.\n * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows.\n * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query\n * @deprecated in 3.7. Use [[createQueryReader]] instead; it accepts the same parameters.\n */\n public async * query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> {\n const builder = new QueryOptionsBuilder(options);\n const reader = this.createQueryReader(ecsql, params, builder.getOptions());\n while (await reader.step())\n yield reader.formatCurrentRow();\n }\n /** Compute number of rows that would be returned by the ECSQL.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * See \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" for details.\n * @returns Return row count.\n * @throws [IModelError]($common) If the statement is invalid\n * @deprecated in 3.7. Count the number of results using `count(*)` where the original query is a subquery instead. E.g., `SELECT count(*) FROM (<query-whose-rows-to-count>)`.\n */\n public async queryRowCount(ecsql: string, params?: QueryBinder): Promise<number> {\n for await (const row of this.createQueryReader(`SELECT count(*) FROM (${ecsql})`, params)) {\n return row[0] as number;\n }\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Failed to get row count\");\n }\n\n /** Cancel any previous query with same token and run execute the current specified query.\n * 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.\n * [ECSQL row]($docs/learning/ECSQLRowFormat).\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param token None empty restart token. The previous query with same token would be cancelled. This would cause\n * exception which user code must handle.\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param options Allow to specify certain flags which control how query is executed.\n * @returns Returns the query result as an *AsyncIterableIterator<any>* which lazy load result as needed. The row format is determined by *rowFormat* parameter.\n * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows.\n * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query\n * @deprecated in 3.7. Use [[createQueryReader]] instead. Pass in the restart token as part of the `config` argument; e.g., `{ restartToken: myToken }` or `new QueryOptionsBuilder().setRestartToken(myToken).getOptions()`.\n */\n public async * restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> {\n for await (const row of this.createQueryReader(ecsql, params, new QueryOptionsBuilder(options).setRestartToken(token).getOptions())) {\n yield row;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ECDb.js","sourceRoot":"","sources":["../../src/ECDb.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAsF;AAEtF,oDAA6I;AAC7I,mEAAgE;AAChE,uDAAoD;AACpD,qDAAuE;AACvE,8DAAyD;AACzD,uDAAoE;AACpE,gDAA+C;AAE/C,MAAM,cAAc,GAAW,6CAAqB,CAAC,IAAI,CAAC;AAE1D;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB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BAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3E,OAAO,MAAM,MAAM,CAAC,IAAI,EAAE;YACxB,MAAM,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACpC,CAAC;IACD;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,MAAoB;QAC5D,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,KAAK,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;YAC1F,OAAO,GAAG,CAAC,CAAC,CAAW,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,yBAAW,CAAC,uBAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,KAAK,CAAC,CAAE,YAAY,CAAC,KAAa,EAAE,KAAa,EAAE,MAAoB,EAAE,OAAsB;QACpG,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,iCAAmB,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;YACpI,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA3bD,oBA2bC","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 ECDb\n */\nimport { assert, DbResult, IDisposable, Logger, OpenMode } from \"@itwin/core-bentley\";\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { DbQueryRequest, ECSchemaProps, ECSqlReader, IModelError, QueryBinder, QueryOptions, QueryOptionsBuilder } from \"@itwin/core-common\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { ConcurrentQuery } from \"./ConcurrentQuery\";\nimport { ECSqlStatement, ECSqlWriteStatement } from \"./ECSqlStatement\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { SqliteStatement, StatementCache } from \"./SqliteStatement\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\nconst loggerCategory: string = BackendLoggerCategory.ECDb;\n\n/** Modes for how to open [ECDb]($backend) files.\n * @public\n */\nexport enum ECDbOpenMode {\n Readonly,\n ReadWrite,\n /** Opens the file read-write and upgrades the file if necessary to the latest file format version. */\n FileUpgrade,\n}\n\n/** An ECDb file\n * @public\n */\nexport class ECDb implements IDisposable {\n private _nativeDb?: IModelJsNative.ECDb;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private readonly _statementCache = new StatementCache<ECSqlStatement>();\n private _sqliteStatementCache = new StatementCache<SqliteStatement>();\n\n /** only for tests\n * @internal\n */\n public resetSqliteCache(size: number) {\n this._sqliteStatementCache.clear();\n this._sqliteStatementCache = new StatementCache<SqliteStatement>(size);\n }\n\n constructor() {\n this._nativeDb = new IModelNative.platform.ECDb();\n }\n /** Call this function when finished with this ECDb object. This releases the native resources held by the\n * ECDb object.\n */\n public dispose(): void {\n if (!this._nativeDb)\n return;\n\n this.closeDb();\n this._nativeDb.dispose();\n this._nativeDb = undefined;\n }\n\n /** Create an ECDb\n * @param pathName The path to the ECDb file to create.\n * @throws [IModelError]($common) if the operation failed.\n */\n public createDb(pathName: string): void {\n const status: DbResult = this[_nativeDb].createDb(pathName);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to created ECDb\");\n }\n\n /** Open the ECDb.\n * @param pathName The path to the ECDb file to open\n * @param openMode Open mode\n * @throws [IModelError]($common) if the operation failed.\n */\n public openDb(pathName: string, openMode: ECDbOpenMode = ECDbOpenMode.Readonly): void {\n const nativeOpenMode: OpenMode = openMode === ECDbOpenMode.Readonly ? OpenMode.Readonly : OpenMode.ReadWrite;\n const tryUpgrade: boolean = openMode === ECDbOpenMode.FileUpgrade;\n const status: DbResult = this[_nativeDb].openDb(pathName, nativeOpenMode, tryUpgrade);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to open ECDb\");\n }\n\n /** Returns true if the ECDb is open */\n public get isOpen(): boolean { return this[_nativeDb].isOpen(); }\n\n /** Close the Db after saving any uncommitted changes.\n * @throws [IModelError]($common) if the database is not open.\n */\n public closeDb(): void {\n this._statementCache.clear();\n this._sqliteStatementCache.clear();\n this[_nativeDb].closeDb();\n }\n\n /** @internal use to test statement caching */\n public clearStatementCache() {\n this._statementCache.clear();\n }\n\n /** @internal use to test statement caching */\n public getCachedStatementCount() {\n return this._statementCache.size;\n }\n\n /** Commit the outermost transaction, writing changes to the file. Then, restart the transaction.\n * @param changesetName The name of the operation that generated these changes.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public saveChanges(changesetName?: string): void {\n const status: DbResult = this[_nativeDb].saveChanges(changesetName);\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to save changes\");\n }\n\n /** Abandon (cancel) the outermost transaction, discarding all changes since last save. Then, restart the transaction.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public abandonChanges(): void {\n const status: DbResult = this[_nativeDb].abandonChanges();\n if (status !== DbResult.BE_SQLITE_OK)\n throw new IModelError(status, \"Failed to abandon changes\");\n }\n\n /** Import a schema.\n *\n * If the import was successful, the database is automatically saved to disk.\n * @param pathName Path to ECSchema XML file to import.\n * @throws [IModelError]($common) if the database is not open or if the operation failed.\n */\n public importSchema(pathName: string): void {\n const status: DbResult = this[_nativeDb].importSchema(pathName);\n if (status !== DbResult.BE_SQLITE_OK) {\n Logger.logError(loggerCategory, `Failed to import schema from '${pathName}'.`);\n throw new IModelError(status, `Failed to import schema from '${pathName}'.`);\n }\n }\n\n /**\n * Returns the full schema for the input name.\n * @param name The name of the schema e.g. 'ECDbMeta'\n * @returns The SchemaProps for the requested schema\n * @throws if the schema can not be found or loaded.\n */\n public getSchemaProps(name: string): ECSchemaProps {\n return this[_nativeDb].getSchemaProps(name);\n }\n\n /**\n * Use a prepared ECSQL statement, potentially from the statement cache. If the requested statement doesn't exist\n * in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved\n * in the statement cache so it can be reused in the future. Use this method for ECSQL statements that will be\n * reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding\n * the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withWriteStatement]]\n * @beta\n */\n public withCachedWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors = true): T {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);\n const release = () => this._statementCache.addOrDispose(stmt);\n try {\n const val = callback(new ECSqlWriteStatement(stmt));\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /**\n * Prepared and execute a callback on an ECSQL statement. After the callback completes the statement is disposed.\n * Use this method for ECSQL statements are either not expected to be reused, or are not expensive to prepare.\n * For statements that will be reused often, instead use [[withPreparedStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withCachedWriteStatement]]\n * @beta\n */\n public withWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors = true): T {\n const stmt = this.prepareWriteStatement(ecsql, logErrors);\n const release = () => stmt.dispose();\n try {\n const val = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /** Prepare an ECSQL statement.\n * @param ecsql The ECSQL statement to prepare\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @throws [IModelError]($common) if there is a problem preparing the statement.\n * @beta\n */\n public prepareWriteStatement(ecsql: string, logErrors = true): ECSqlWriteStatement {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return new ECSqlWriteStatement(this.prepareStatement(ecsql, logErrors));\n }\n\n /**\n * Use a prepared ECSQL statement, potentially from the statement cache. If the requested statement doesn't exist\n * in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved\n * in the statement cache so it can be reused in the future. Use this method for ECSQL statements that will be\n * reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding\n * the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withStatement]]\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 [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors = true): T {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const stmt = this._statementCache.findAndRemove(ecsql) ?? this.prepareStatement(ecsql, logErrors);\n const release = () => this._statementCache.addOrDispose(stmt);\n try {\n const val = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /**\n * Prepared and execute a callback on an ECSQL statement. After the callback completes the statement is disposed.\n * Use this method for ECSQL statements are either not expected to be reused, or are not expensive to prepare.\n * For statements that will be reused often, instead use [[withPreparedStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withPreparedStatement]]\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 [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors = true): T {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const stmt = this.prepareStatement(ecsql, logErrors);\n const release = () => stmt.dispose();\n try {\n const val = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /** Prepare an ECSQL statement.\n * @param ecsql The ECSQL statement to prepare\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @throws [IModelError]($common) if there is a problem preparing the statement.\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 [ECDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public prepareStatement(ecsql: string, logErrors = true): ECSqlStatement {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const stmt = new ECSqlStatement();\n stmt.prepare(this[_nativeDb], ecsql, logErrors);\n return stmt;\n }\n\n /**\n * Use a prepared SQL statement, potentially from the statement cache. If the requested statement doesn't exist\n * in the statement cache, a new statement is prepared. After the callback completes, the statement is reset and saved\n * in the statement cache so it can be reused in the future. Use this method for SQL statements that will be\n * reused often and are expensive to prepare. The statement cache holds the most recently used statements, discarding\n * the oldest statements as it fills. For statements you don't intend to reuse, instead use [[withSqliteStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @see [[withPreparedStatement]]\n * @public\n */\n public withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors = true): T {\n const stmt = this._sqliteStatementCache.findAndRemove(sql) ?? this.prepareSqliteStatement(sql, logErrors);\n const release = () => this._sqliteStatementCache.addOrDispose(stmt);\n try {\n const val: T = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /**\n * Prepared and execute a callback on a SQL statement. After the callback completes the statement is disposed.\n * Use this method for SQL statements are either not expected to be reused, or are not expensive to prepare.\n * For statements that will be reused often, instead use [[withPreparedSqliteStatement]].\n * @param sql The SQLite SQL statement to execute\n * @param callback the callback to invoke on the prepared statement\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @returns the value returned by `callback`.\n * @public\n */\n public withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors = true): T {\n const stmt = this.prepareSqliteStatement(sql, logErrors);\n const release = () => stmt.dispose();\n try {\n const val: T = callback(stmt);\n if (val instanceof Promise) {\n val.then(release, release);\n } else {\n release();\n }\n return val;\n } catch (err) {\n release();\n throw err;\n }\n }\n\n /** Prepare an SQL statement.\n * @param sql The SQLite SQL statement to prepare\n * @param logErrors Determines if error will be logged if statement fail to prepare\n * @throws [IModelError]($common) if there is a problem preparing the statement.\n * @internal\n */\n public prepareSqliteStatement(sql: string, logErrors = true): SqliteStatement {\n const stmt = new SqliteStatement(sql);\n stmt.prepare(this[_nativeDb], logErrors);\n return stmt;\n }\n\n /** @internal\n * @deprecated in 4.8. This internal API will be removed in 5.0. Use ECDb's public API instead.\n */\n public get nativeDb(): IModelJsNative.ECDb { return this[_nativeDb]; }\n\n /** @internal */\n public get [_nativeDb](): IModelJsNative.ECDb {\n assert(undefined !== this._nativeDb);\n return this._nativeDb;\n }\n\n /** Allow to execute query and read results along with meta data. The result are streamed.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n * - [ECSQL Row Format]($docs/learning/ECSQLRowFormat)\n *\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param config Allow to specify certain flags which control how query is executed.\n * @returns Returns an [ECSqlReader]($common) which helps iterate over the result set and also give access to metadata.\n * @public\n * */\n public createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader {\n if (!this._nativeDb || !this._nativeDb.isOpen()) {\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"db not open\");\n }\n const executor = {\n execute: async (request: DbQueryRequest) => {\n return ConcurrentQuery.executeQueryRequest(this[_nativeDb], request);\n },\n };\n return new ECSqlReader(executor, ecsql, params, config);\n }\n\n /** Execute a query and stream its results\n * 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.\n * [ECSQL row]($docs/learning/ECSQLRowFormat).\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param options Allow to specify certain flags which control how query is executed.\n * @returns Returns the query result as an *AsyncIterableIterator<any>* which lazy load result as needed. The row format is determined by *rowFormat* parameter.\n * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows.\n * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query\n * @deprecated in 3.7. Use [[createQueryReader]] instead; it accepts the same parameters.\n */\n public async * query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> {\n const builder = new QueryOptionsBuilder(options);\n const reader = this.createQueryReader(ecsql, params, builder.getOptions());\n while (await reader.step())\n yield reader.formatCurrentRow();\n }\n /** Compute number of rows that would be returned by the ECSQL.\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * See \"[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)\" for details.\n * @returns Return row count.\n * @throws [IModelError]($common) If the statement is invalid\n * @deprecated in 3.7. Count the number of results using `count(*)` where the original query is a subquery instead. E.g., `SELECT count(*) FROM (<query-whose-rows-to-count>)`.\n */\n public async queryRowCount(ecsql: string, params?: QueryBinder): Promise<number> {\n for await (const row of this.createQueryReader(`SELECT count(*) FROM (${ecsql})`, params)) {\n return row[0] as number;\n }\n throw new IModelError(DbResult.BE_SQLITE_ERROR, \"Failed to get row count\");\n }\n\n /** Cancel any previous query with same token and run execute the current specified query.\n * 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.\n * [ECSQL row]($docs/learning/ECSQLRowFormat).\n *\n * See also:\n * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)\n * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)\n *\n * @param ecsql The ECSQL statement to execute\n * @param token None empty restart token. The previous query with same token would be cancelled. This would cause\n * exception which user code must handle.\n * @param params The values to bind to the parameters (if the ECSQL has any).\n * @param options Allow to specify certain flags which control how query is executed.\n * @returns Returns the query result as an *AsyncIterableIterator<any>* which lazy load result as needed. The row format is determined by *rowFormat* parameter.\n * See [ECSQL row format]($docs/learning/ECSQLRowFormat) for details about the format of the returned rows.\n * @throws [IModelError]($common) If there was any error while submitting, preparing or stepping into query\n * @deprecated in 3.7. Use [[createQueryReader]] instead. Pass in the restart token as part of the `config` argument; e.g., `{ restartToken: myToken }` or `new QueryOptionsBuilder().setRestartToken(myToken).getOptions()`.\n */\n public async * restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> {\n for await (const row of this.createQueryReader(ecsql, params, new QueryOptionsBuilder(options).setRestartToken(token).getOptions())) {\n yield row;\n }\n }\n}\n"]}
|
|
@@ -55,6 +55,10 @@ export interface ECSqlRowArg {
|
|
|
55
55
|
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
56
56
|
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
57
57
|
* @public
|
|
58
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
59
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
60
|
+
* [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.
|
|
61
|
+
* Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
58
62
|
*/
|
|
59
63
|
export declare class ECSqlStatement implements IterableIterator<any>, IDisposable {
|
|
60
64
|
private _stmt;
|
|
@@ -252,6 +256,184 @@ export declare class ECSqlStatement implements IterableIterator<any>, IDisposabl
|
|
|
252
256
|
*/
|
|
253
257
|
getValue(columnIx: number): ECSqlValue;
|
|
254
258
|
}
|
|
259
|
+
/** Executes ECSQL INSERT/UPDATE/DELETE statements.
|
|
260
|
+
*
|
|
261
|
+
* A statement must be prepared before it can be executed, and it must be released when no longer needed.
|
|
262
|
+
* See [ECDb.withCachedWriteStatement]($backend) for a convenient and
|
|
263
|
+
* reliable way to prepare, execute, and then release a statement.
|
|
264
|
+
*
|
|
265
|
+
* A statement may contain parameters that must be filled in before use by the **bind** methods.
|
|
266
|
+
*
|
|
267
|
+
* Once prepared (and parameters are bound, if any), the statement is executed by calling [ECSqlStatement.stepForInsert]($backend).
|
|
268
|
+
*
|
|
269
|
+
* > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared
|
|
270
|
+
* > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.
|
|
271
|
+
* > The key to making this strategy work is to phrase a statement in a general way and use placeholders to represent parameters that will vary on each use.
|
|
272
|
+
*
|
|
273
|
+
* See also
|
|
274
|
+
* - [Executing ECSQL]($docs/learning/backend/ExecutingECSQL) provides more background on ECSQL and an introduction on how to execute ECSQL with the iTwin.js API.
|
|
275
|
+
* - [Code Examples]($docs/learning/backend/ECSQLCodeExamples) illustrate the use of the iTwin.js API for executing and working with ECSQL
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
export declare class ECSqlWriteStatement implements IDisposable {
|
|
279
|
+
private _stmt;
|
|
280
|
+
constructor(stmt?: ECSqlStatement);
|
|
281
|
+
get sql(): string;
|
|
282
|
+
/** Check if this statement has been prepared successfully or not */
|
|
283
|
+
get isPrepared(): boolean;
|
|
284
|
+
/** Get the underlying ECSqlStatement. Needed until we remove ECSqlStatement.
|
|
285
|
+
* @param
|
|
286
|
+
* @internal
|
|
287
|
+
*/
|
|
288
|
+
get stmt(): ECSqlStatement;
|
|
289
|
+
/** Prepare this statement prior to first use.
|
|
290
|
+
* @param db The ECDb to prepare the statement against
|
|
291
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
292
|
+
* @param logErrors Determine if errors are logged or not
|
|
293
|
+
* @throws [IModelError]($common) if the ECSQL statement cannot be prepared. Normally, prepare fails due to ECSQL syntax errors or references to tables or properties that do not exist.
|
|
294
|
+
* The error.message property will provide details.
|
|
295
|
+
* @internal
|
|
296
|
+
*/
|
|
297
|
+
prepare(db: IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): void;
|
|
298
|
+
/** Prepare this statement prior to first use.
|
|
299
|
+
* @param db The DgnDb or ECDb to prepare the statement against
|
|
300
|
+
* @param ecsql The ECSQL statement string to prepare
|
|
301
|
+
* @param logErrors Determine if errors are logged or not, its set to false by default for tryPrepare()
|
|
302
|
+
* @returns An object with a `status` member equal to [DbResult.BE_SQLITE_OK]($bentley) on success. Upon error, the `message` member will provide details.
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): {
|
|
306
|
+
status: DbResult;
|
|
307
|
+
message: string;
|
|
308
|
+
};
|
|
309
|
+
/** Reset this statement so that the next call to step will return the first row, if any. */
|
|
310
|
+
reset(): void;
|
|
311
|
+
/** Get the Native SQL statement
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
getNativeSql(): string;
|
|
315
|
+
/** Call this function when finished with this statement. This releases the native resources held by the statement.
|
|
316
|
+
*
|
|
317
|
+
* > Do not call this method directly on a statement that is being managed by a statement cache.
|
|
318
|
+
*/
|
|
319
|
+
dispose(): void;
|
|
320
|
+
/** Binds the specified value to the specified ECSQL parameter.
|
|
321
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
322
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
323
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
324
|
+
*/
|
|
325
|
+
bindValue(parameter: number | string, val: any): void;
|
|
326
|
+
/** Binds null to the specified ECSQL parameter.
|
|
327
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
328
|
+
*/
|
|
329
|
+
bindNull(parameter: number | string): void;
|
|
330
|
+
/** Binds a BLOB value to the specified ECSQL parameter.
|
|
331
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
332
|
+
* @param BLOB value as either a Uint8Array, ArrayBuffer or a Base64 string
|
|
333
|
+
*/
|
|
334
|
+
bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
|
|
335
|
+
/** Binds a boolean value to the specified ECSQL parameter.
|
|
336
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
337
|
+
* @param val Boolean value
|
|
338
|
+
*/
|
|
339
|
+
bindBoolean(parameter: number | string, val: boolean): void;
|
|
340
|
+
/** Binds a DateTime value to the specified ECSQL parameter.
|
|
341
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
342
|
+
* @param isoDateTimeString DateTime value as ISO8601 string
|
|
343
|
+
*/
|
|
344
|
+
bindDateTime(parameter: number | string, isoDateTimeString: string): void;
|
|
345
|
+
/** Binds a double value to the specified ECSQL parameter.
|
|
346
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
347
|
+
* @param val Double value
|
|
348
|
+
*/
|
|
349
|
+
bindDouble(parameter: number | string, val: number): void;
|
|
350
|
+
/** Binds an GUID value to the specified ECSQL parameter.
|
|
351
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
352
|
+
* @param val GUID value
|
|
353
|
+
*/
|
|
354
|
+
bindGuid(parameter: number | string, val: GuidString): void;
|
|
355
|
+
/** Binds an Id value to the specified ECSQL parameter.
|
|
356
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
357
|
+
* @param val Id value
|
|
358
|
+
*/
|
|
359
|
+
bindId(parameter: number | string, val: Id64String): void;
|
|
360
|
+
/** Binds an integer value to the specified ECSQL parameter.
|
|
361
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
362
|
+
* @param val Integer value as number, decimal string or hexadecimal string.
|
|
363
|
+
*/
|
|
364
|
+
bindInteger(parameter: number | string, val: number | string): void;
|
|
365
|
+
/** Binds an Point2d value to the specified ECSQL parameter.
|
|
366
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
367
|
+
* @param val Point2d value
|
|
368
|
+
*/
|
|
369
|
+
bindPoint2d(parameter: number | string, val: XAndY): void;
|
|
370
|
+
/** Binds an Point3d value to the specified ECSQL parameter.
|
|
371
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
372
|
+
* @param val Point3d value
|
|
373
|
+
*/
|
|
374
|
+
bindPoint3d(parameter: number | string, val: XYAndZ): void;
|
|
375
|
+
/** Binds a Range3d as a blob to the specified ECSQL parameter
|
|
376
|
+
* @param parameter Index(1-based) or name of the parameter
|
|
377
|
+
* @param val Range3d value
|
|
378
|
+
*/
|
|
379
|
+
bindRange3d(parameter: number | string, val: LowAndHighXYZ): void;
|
|
380
|
+
/** Binds an string to the specified ECSQL parameter.
|
|
381
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
382
|
+
* @param val String value
|
|
383
|
+
*/
|
|
384
|
+
bindString(parameter: number | string, val: string): void;
|
|
385
|
+
/** Binds a navigation property value to the specified ECSQL parameter.
|
|
386
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
387
|
+
* @param val Navigation property value
|
|
388
|
+
*/
|
|
389
|
+
bindNavigation(parameter: number | string, val: NavigationBindingValue): void;
|
|
390
|
+
/** Binds a struct property value to the specified ECSQL parameter.
|
|
391
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
392
|
+
* @param val Struct value. The struct value is an object composed of pairs of a struct member property name and its value
|
|
393
|
+
* (of one of the supported types)
|
|
394
|
+
*/
|
|
395
|
+
bindStruct(parameter: number | string, val: object): void;
|
|
396
|
+
/** Binds an array value to the specified ECSQL parameter.
|
|
397
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
398
|
+
* @param val Array value. The array value is an array of values of the supported types
|
|
399
|
+
*/
|
|
400
|
+
bindArray(parameter: number | string, val: any[]): void;
|
|
401
|
+
bindIdSet(parameter: number | string, val: Id64String[]): void;
|
|
402
|
+
/**
|
|
403
|
+
* Gets a binder to bind a value for an ECSQL parameter
|
|
404
|
+
* > This is the most low-level API to bind a value to a specific parameter. Alternatively you can use the ECSqlStatement.bindXX methods
|
|
405
|
+
* > or [ECSqlStatement.bindValues]($backend).
|
|
406
|
+
* @param parameter Index (1-based) or name of the parameter
|
|
407
|
+
*/
|
|
408
|
+
getBinder(parameter: string | number): ECSqlBinder;
|
|
409
|
+
/** Bind values to all parameters in the statement.
|
|
410
|
+
* @param values The values to bind to the parameters.
|
|
411
|
+
* Pass an *array* of values if the parameters are *positional*.
|
|
412
|
+
* Pass an *object of the values keyed on the parameter name* for *named parameters*.
|
|
413
|
+
* The values in either the array or object must match the respective types of the parameter.
|
|
414
|
+
*
|
|
415
|
+
* The section "[iTwin.js Types used in ECSQL Parameter Bindings]($docs/learning/ECSQLParameterTypes)" describes the
|
|
416
|
+
* iTwin.js types to be used for the different ECSQL parameter types.
|
|
417
|
+
*
|
|
418
|
+
* See also these [Code Samples]($docs/learning/backend/ECSQLCodeExamples#binding-to-all-parameters-at-once)
|
|
419
|
+
*/
|
|
420
|
+
bindValues(values: any[] | object): void;
|
|
421
|
+
/** Clear any bindings that were previously set on this statement.
|
|
422
|
+
* @throws [IModelError]($common) in case of errors
|
|
423
|
+
*/
|
|
424
|
+
clearBindings(): void;
|
|
425
|
+
/** Step this INSERT statement and returns status and the ECInstanceId of the newly
|
|
426
|
+
* created instance.
|
|
427
|
+
*
|
|
428
|
+
* > Insert statements can be used with ECDb only, not with IModelDb.
|
|
429
|
+
*
|
|
430
|
+
* @returns Returns the generated ECInstanceId in case of success and the status of the step
|
|
431
|
+
* call. In case of error, the respective error code is returned.
|
|
432
|
+
*/
|
|
433
|
+
stepForInsert(): ECSqlInsertResult;
|
|
434
|
+
/** Get the query result's column count (only for ECSQL SELECT statements). */
|
|
435
|
+
getColumnCount(): number;
|
|
436
|
+
}
|
|
255
437
|
/** Binds a value to an ECSQL parameter.
|
|
256
438
|
*
|
|
257
439
|
* See also:
|
|
@@ -355,6 +537,10 @@ export declare class ECSqlBinder {
|
|
|
355
537
|
* - [[ECSqlStatement.getValue]]
|
|
356
538
|
* - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
357
539
|
* @public
|
|
540
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
541
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
542
|
+
* [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.
|
|
543
|
+
* Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
358
544
|
*/
|
|
359
545
|
export interface ECEnumValue {
|
|
360
546
|
schema: string;
|
|
@@ -369,7 +555,11 @@ export interface ECEnumValue {
|
|
|
369
555
|
* - [ECSqlStatement.getValue]($backend)
|
|
370
556
|
* - [Code Samples]($docs/learning/backend/ECSQLCodeExamples#working-with-the-query-result)
|
|
371
557
|
* @public
|
|
372
|
-
|
|
558
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
559
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
560
|
+
* [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.
|
|
561
|
+
* Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
562
|
+
*/
|
|
373
563
|
export declare class ECSqlValue {
|
|
374
564
|
private _val;
|
|
375
565
|
/** @internal */
|
|
@@ -434,7 +624,11 @@ export declare class ECSqlValue {
|
|
|
434
624
|
/** Iterator over members of a struct [ECSqlValue]($backend) or the elements of an array [ECSqlValue]($backend).
|
|
435
625
|
* See [ECSqlValue.getStructIterator]($backend) or [ECSqlValue.getArrayIterator]($backend).
|
|
436
626
|
* @public
|
|
437
|
-
|
|
627
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
628
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
629
|
+
* [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.
|
|
630
|
+
* Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
631
|
+
*/
|
|
438
632
|
export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
|
|
439
633
|
private _it;
|
|
440
634
|
/** @internal */
|
|
@@ -445,6 +639,10 @@ export declare class ECSqlValueIterator implements IterableIterator<ECSqlValue>
|
|
|
445
639
|
/** Information about an ECSQL column in an ECSQL query result.
|
|
446
640
|
* See [ECSqlValue.columnInfo]($backend), [ECSqlStatement.getValue]($backend), [ECSqlStatement]($backend)
|
|
447
641
|
* @public
|
|
642
|
+
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
643
|
+
* For ECDb, use [ECDb.withCachedWriteStatement]($backend) or [ECDb.withWriteStatement]($backend) to Insert/Update/Delete.
|
|
644
|
+
* [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.
|
|
645
|
+
* Mean while use [IModelDb.withPreparedStatement]($backend) for synchronous API calls where conversion to async is not possible.
|
|
448
646
|
*/
|
|
449
647
|
export interface ECSqlColumnInfo {
|
|
450
648
|
/** Gets the data type of the column.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlStatement.d.ts","sourceRoot":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