Skip to content

Commit d211233

Browse files
Add version check to databases-ui
Co-authored by: Marc Jaramillo mnj.webdeveloper@gmail.com Co-authored by: Musab Guma'a mgsium@github.com
1 parent 4f68c5c commit d211233

1 file changed

Lines changed: 33 additions & 17 deletions

File tree

extensions/ql-vscode/src/databases-ui.ts

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -451,19 +451,26 @@ export class DatabaseUI extends DisposableObject {
451451
handleChooseDatabaseInternet = async (
452452
progress: ProgressCallback,
453453
token: CancellationToken
454-
): Promise<
455-
DatabaseItem | undefined
456-
> => {
454+
): Promise<DatabaseItem | undefined> => {
457455
if (!this.queryServer) {
458456
throw new Error('Query server not started');
459457
}
460-
return await promptImportInternetDatabase(
461-
this.databaseManager,
462-
this.storagePath,
463-
progress,
464-
token,
465-
this.queryServer.cliServer
466-
);
458+
if (await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
459+
return await promptImportInternetDatabase(
460+
this.databaseManager,
461+
this.storagePath,
462+
progress,
463+
token,
464+
this.queryServer.cliServer
465+
);
466+
} else {
467+
return await promptImportInternetDatabase(
468+
this.databaseManager,
469+
this.storagePath,
470+
progress,
471+
token
472+
);
473+
}
467474
};
468475

469476
handleChooseDatabaseLgtm = async (
@@ -473,13 +480,22 @@ export class DatabaseUI extends DisposableObject {
473480
if (!this.queryServer) {
474481
throw new Error('Query server not started');
475482
}
476-
return await promptImportLgtmDatabase(
477-
this.databaseManager,
478-
this.storagePath,
479-
progress,
480-
token,
481-
this.queryServer.cliServer
482-
);
483+
if (await this.queryServer.cliServer.cliConstraints.supportsDatabaseUnbundle()) {
484+
return await promptImportLgtmDatabase(
485+
this.databaseManager,
486+
this.storagePath,
487+
progress,
488+
token,
489+
this.queryServer.cliServer
490+
);
491+
} else {
492+
return await promptImportLgtmDatabase(
493+
this.databaseManager,
494+
this.storagePath,
495+
progress,
496+
token
497+
);
498+
}
483499
};
484500

485501
async tryUpgradeCurrentDatabase(

0 commit comments

Comments
 (0)