mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 09:35:37 -05:00
Fix create project from database for contained database (#15618)
This commit is contained in:
@@ -228,9 +228,16 @@ export class CreateProjectFromDatabaseDialog {
|
||||
// populate database dropdown with the databases for this connection
|
||||
if (connectionId) {
|
||||
this.sourceDatabaseDropDown!.loading = true;
|
||||
const databaseValues = (await azdata.connection.listDatabases(connectionId))
|
||||
// filter out system dbs
|
||||
.filter(db => !constants.systemDbs.includes(db));
|
||||
let databaseValues;
|
||||
try {
|
||||
databaseValues = (await azdata.connection.listDatabases(connectionId))
|
||||
// filter out system dbs
|
||||
.filter(db => !constants.systemDbs.includes(db));
|
||||
} catch (e) {
|
||||
// if the user doesn't have access to master, just set the database of the connection profile
|
||||
databaseValues = [databaseName!];
|
||||
console.warn(e);
|
||||
}
|
||||
|
||||
this.sourceDatabaseDropDown!.values = databaseValues;
|
||||
this.sourceDatabaseDropDown!.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user