Fix for issue where bulk-adding scripts could perform a rescan after each script (#22665)

* Changed bulk script add to delay reloading file list until end of operation.

* Adding style name to sqlproj typing file

* vBump to 1.0.1
This commit is contained in:
Benjin Dubishar
2023-04-10 16:28:53 -07:00
committed by GitHub
parent 6857718cb3
commit 4d3d74e3da
3 changed files with 19 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
"name": "sql-database-projects",
"displayName": "SQL Database Projects",
"description": "Enables users to develop and publish database schemas for MSSQL Databases",
"version": "1.0.0",
"version": "1.0.1",
"publisher": "Microsoft",
"preview": false,
"engines": {

View File

@@ -117,6 +117,10 @@ export class Project implements ISqlProject {
return this._sqlProjStyle;
}
public get sqlProjStyleName(): string {
return this.sqlProjStyle === ProjectType.SdkStyle ? 'SdkStyle' : 'LegacyStyle';
}
public get isCrossPlatformCompatible(): boolean {
return this._isCrossPlatformCompatible;
}
@@ -494,18 +498,23 @@ export class Project implements ISqlProject {
//#region SQL object scripts
public async addSqlObjectScript(relativePath: string): Promise<void> {
public async addSqlObjectScript(relativePath: string, reloadAfter: boolean = true): Promise<void> {
const result = await this.sqlProjService.addSqlObjectScript(this.projectFilePath, relativePath);
this.throwIfFailed(result);
await this.readFilesInProject();
await this.readFolders();
if (reloadAfter) {
await this.readFilesInProject();
await this.readFolders();
}
}
public async addSqlObjectScripts(relativePaths: string[]): Promise<void> {
for (const path of relativePaths) {
await this.addSqlObjectScript(path);
await this.addSqlObjectScript(path, false /* reloadAfter */);
}
await this.readFilesInProject();
await this.readFolders();
}
public async deleteSqlObjectScript(relativePath: string): Promise<void> {

View File

@@ -215,6 +215,11 @@ declare module 'sqldbproj' {
*/
getDatabaseDefaultCollation(): string;
/**
* Type of .sqlproj file, either "SdkStyle" or "LegacyStyle"
*/
readonly sqlProjStyleName: string;
/**
* Path where dacpac is output to after a successful build
*/