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

Allow attach/detach db to IModelDb connection #7530

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
rush extract-api
  • Loading branch information
khanaffan committed Jan 8, 2025
commit a9207436cdc0d0ee396b0717673c72fd190763f4
4 changes: 4 additions & 0 deletions common/api/core-backend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,13 @@ export class ECDb implements IDisposable {
get [_nativeDb](): IModelJsNative.ECDb;
constructor();
abandonChanges(): void;
attachDb(fileName: string, alias: string): void;
// @internal
clearStatementCache(): void;
closeDb(): void;
createDb(pathName: string): void;
createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader;
detachDb(alias: string): void;
dispose(): void;
// @internal
getCachedStatementCount(): number;
Expand Down Expand Up @@ -3117,6 +3119,7 @@ export abstract class IModelDb extends IModel {
});
abandonChanges(): void;
acquireSchemaLock(): Promise<void>;
attachDb(fileName: string, alias: string): void;
// @internal
protected beforeClose(): void;
// @internal
Expand Down Expand Up @@ -3149,6 +3152,7 @@ export abstract class IModelDb extends IModel {
deleteFileProperty(prop: FilePropertyProps): void;
// @beta
deleteSettingDictionary(name: string): void;
detachDb(alias: string): void;
// @beta
elementGeometryCacheOperation(requestProps: ElementGeometryCacheOperationRequestProps): BentleyStatus;
// @beta
Expand Down
1 change: 0 additions & 1 deletion core/backend/src/test/ecdb/ECDb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ describe("ECDb", () => {
testECDb.detachDb("source");
});

// Crash!!!
await using(ECDbTestHelper.createECDb(outDir, "file4.ecdb"), async (testECDb: ECDb) => {
testECDb.attachDb(ecdbPath1, "source");
const reader = testECDb.createQueryReader("SELECT Name, Age FROM source.test.Person");
Expand Down