Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate UseJsPropertyNames and ECSqlStatement (which defaults to UseJsPropertyNames) #7315

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 61 additions & 5 deletions common/api/core-backend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,10 @@ export class ECDb implements Disposable {
openDb(pathName: string, openMode?: ECDbOpenMode): void;
// @internal
prepareSqliteStatement(sql: string, logErrors?: boolean): SqliteStatement;
// @deprecated
prepareStatement(ecsql: string, logErrors?: boolean): ECSqlStatement;
// @beta
prepareWriteStatement(ecsql: string, logErrors?: boolean): ECSqlWriteStatement;
// @deprecated
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any>;
// @deprecated
Expand All @@ -1810,10 +1813,16 @@ export class ECDb implements Disposable {
// @deprecated
restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any>;
saveChanges(changesetName?: string): void;
// @beta
withCachedWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors?: boolean): T;
withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors?: boolean): T;
// @deprecated
withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T;
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors?: boolean): T;
// @deprecated
withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T;
// @beta
withWriteStatement<T>(ecsql: string, callback: (stmt: ECSqlWriteStatement) => T, logErrors?: boolean): T;
}

// @public
Expand All @@ -1825,7 +1834,7 @@ export enum ECDbOpenMode {
ReadWrite = 1
}

// @public
// @public @deprecated
export interface ECEnumValue {
// (undocumented)
key: string;
Expand Down Expand Up @@ -1875,7 +1884,7 @@ export class ECSqlBinder {
bindStruct(val: object): void;
}

// @public
// @public @deprecated
export interface ECSqlColumnInfo {
getAccessString(): string;
getOriginPropertyName(): string | undefined;
Expand Down Expand Up @@ -1904,7 +1913,7 @@ export interface ECSqlRowArg {
rowFormat?: QueryRowFormat;
}

// @public
// @public @deprecated
export class ECSqlStatement implements IterableIterator<any>, Disposable {
[Symbol.dispose](): void;
[Symbol.iterator](): IterableIterator<any>;
Expand Down Expand Up @@ -1954,7 +1963,7 @@ export class ECSqlStatement implements IterableIterator<any>, Disposable {
};
}

// @public
// @public @deprecated
export class ECSqlValue {
// @internal
constructor(val: IModelJsNative.ECSqlValue);
Expand All @@ -1981,7 +1990,7 @@ export class ECSqlValue {
get value(): any;
}

// @public
// @public @deprecated
export class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
// (undocumented)
[Symbol.iterator](): IterableIterator<ECSqlValue>;
Expand All @@ -1991,6 +2000,49 @@ export class ECSqlValueIterator implements IterableIterator<ECSqlValue> {
next(): IteratorResult<ECSqlValue>;
}

// @public
export class ECSqlWriteStatement {
constructor(stmt?: ECSqlStatement);
bindArray(parameter: number | string, val: any[]): void;
bindBlob(parameter: number | string, blob: string | Uint8Array | ArrayBuffer | SharedArrayBuffer): void;
bindBoolean(parameter: number | string, val: boolean): void;
bindDateTime(parameter: number | string, isoDateTimeString: string): void;
bindDouble(parameter: number | string, val: number): void;
bindGuid(parameter: number | string, val: GuidString): void;
bindId(parameter: number | string, val: Id64String): void;
// (undocumented)
bindIdSet(parameter: number | string, val: Id64String[]): void;
bindInteger(parameter: number | string, val: number | string): void;
bindNavigation(parameter: number | string, val: NavigationBindingValue): void;
bindNull(parameter: number | string): void;
bindPoint2d(parameter: number | string, val: XAndY): void;
bindPoint3d(parameter: number | string, val: XYAndZ): void;
bindRange3d(parameter: number | string, val: LowAndHighXYZ): void;
bindString(parameter: number | string, val: string): void;
bindStruct(parameter: number | string, val: object): void;
bindValue(parameter: number | string, val: any): void;
bindValues(values: any[] | object): void;
clearBindings(): void;
getBinder(parameter: string | number): ECSqlBinder;
getColumnCount(): number;
// @internal
getNativeSql(): string;
get isPrepared(): boolean;
// @internal
prepare(db: IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): void;
reset(): void;
// (undocumented)
get sql(): string;
stepForInsert(): ECSqlInsertResult;
// @internal
get stmt(): ECSqlStatement;
// @internal
tryPrepare(db: IModelJsNative.DgnDb | IModelJsNative.ECDb, ecsql: string, logErrors?: boolean): {
status: DbResult;
message: string;
};
}

// @beta
export interface EditableWorkspaceContainer extends WorkspaceContainer {
abandonChanges(): void;
Expand Down Expand Up @@ -3241,6 +3293,7 @@ export abstract class IModelDb extends IModel {
performCheckpoint(): void;
// @internal
prepareSqliteStatement(sql: string, logErrors?: boolean): SqliteStatement;
// @deprecated
prepareStatement(sql: string, logErrors?: boolean): ECSqlStatement;
// @deprecated
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any>;
Expand Down Expand Up @@ -3282,6 +3335,7 @@ export abstract class IModelDb extends IModel {
readonly tiles: IModelDb.Tiles;
static tryFindByKey(key: string): IModelDb | undefined;
tryGetMetaData(classFullName: string): EntityMetaData | undefined;
// @deprecated
tryPrepareStatement(sql: string): ECSqlStatement | undefined;
updateEcefLocation(ecef: EcefLocation): void;
// @beta
Expand All @@ -3294,8 +3348,10 @@ export abstract class IModelDb extends IModel {
// @internal
get watchFilePathName(): LocalFileName;
withPreparedSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors?: boolean): T;
// @deprecated
withPreparedStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T;
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors?: boolean): T;
// @deprecated
withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T;
// @beta
get workspace(): Workspace;
Expand Down
2 changes: 2 additions & 0 deletions common/api/core-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7401,6 +7401,7 @@ export interface QueryLimit {
// @public
export interface QueryOptions extends BaseReaderOptions {
abbreviateBlobs?: boolean;
// @deprecated
convertClassIdsToClassNames?: boolean;
includeMetaData?: boolean;
limit?: QueryLimit;
Expand All @@ -7414,6 +7415,7 @@ export class QueryOptionsBuilder {
// (undocumented)
getOptions(): QueryOptions;
setAbbreviateBlobs(val: boolean): this;
// @deprecated
setConvertClassIdsToNames(val: boolean): this;
// @internal
setDelay(val: number): this;
Expand Down
6 changes: 6 additions & 0 deletions common/api/summary/core-backend.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,20 @@ beta;class;DriverBundleElement
public;class;ECDb
public;enum;ECDbOpenMode
public;interface;ECEnumValue
deprecated;interface;ECEnumValue
beta;class;ECSchemaXmlContext
public;class;ECSqlBinder
public;interface;ECSqlColumnInfo
deprecated;interface;ECSqlColumnInfo
public;class;ECSqlInsertResult
public;interface;ECSqlRowArg
public;class;ECSqlStatement
deprecated;class;ECSqlStatement
public;class;ECSqlValue
deprecated;class;ECSqlValue
public;class;ECSqlValueIterator
deprecated;class;ECSqlValueIterator
public;class;ECSqlWriteStatement
beta;interface;EditableWorkspaceContainer
beta;interface;EditableWorkspaceDb
public;class;ElementAspect
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-common",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/core-common"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-quantity",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/core-quantity"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/linear-referencing-backend",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/linear-referencing-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/physical-material-backend",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/physical-material-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/presentation-backend",
"comment": "Depreciate ECSqlStatement API",
"type": "none"
}
],
"packageName": "@itwin/presentation-backend"
}
Loading