diff --git a/build/lib/extensions.js b/build/lib/extensions.js index 167dc4629b..7506286ab6 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -249,7 +249,8 @@ const sqlBuiltInExtensions = [ 'import', 'profiler', 'admin-pack', - 'big-data-cluster' + 'big-data-cluster', + 'dacpac' ]; var azureExtensions = ['azurecore', 'mssql']; const builtInExtensions = require('../builtInExtensions.json'); diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 7cbece5db9..f8312f1a2b 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -296,7 +296,8 @@ const sqlBuiltInExtensions = [ 'import', 'profiler', 'admin-pack', - 'big-data-cluster' + 'big-data-cluster', + 'dacpac' ]; var azureExtensions = ['azurecore', 'mssql']; // {{SQL CARBON EDIT}} - End diff --git a/extensions/dacpac/README.md b/extensions/dacpac/README.md new file mode 100644 index 0000000000..8341633f08 --- /dev/null +++ b/extensions/dacpac/README.md @@ -0,0 +1,37 @@ +# Microsoft SQL Server Dacpac for Azure Data Studio + +Microsoft SQL Server Dacpac for Azure Data Studio includes the wizard: +- [Data-tier Application Wizard.](#data-tier-application-wizard-preview) + +## Data-tier Application Wizard *(preview)* +**The Data-tier Application Wizard** provides an easy to use experience to deploy and extract .dacpac files and import and export .bacpac files. + +This experience is currently in its initial preview. Please report issues and feature requests [here.](https://github.com/microsoft/azuredatastudio/issues) + + + + ### Requirements + * This wizard requires an active connection to a SQL Server instance to start. + + ### How do I start the Data-tier Application wizard? + * The main entry point for the wizard is to right click a database in the Object Explorer, and click **Data-tier Application wizard**. + * If a user is connected to a SQL Server instance, the user can also start the wizard from the command palette (Ctrl+Shift+P) by searching for **Data-tier Application wizard.** + + ### Why would I use the Data-tier Application wizard? + This wizard was created to add the ability to extract and deploy .dacpac files and import and export .bacpac files in Azure Data Studio. + +To learn more about Data-Tier Applications and working with dacpac and bacpac files, [you can read more here.](https://docs.microsoft.com/en-us/sql/relational-databases/data-tier-applications/data-tier-applications?view=sql-server-2017) + +## Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Privacy Statement + +The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement) describes the privacy statement of this software. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the [Source EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt). diff --git a/extensions/dacpac/images/sqlserver.png b/extensions/dacpac/images/sqlserver.png new file mode 100644 index 0000000000..d884faa14a Binary files /dev/null and b/extensions/dacpac/images/sqlserver.png differ diff --git a/extensions/dacpac/package.json b/extensions/dacpac/package.json new file mode 100644 index 0000000000..1a1274d897 --- /dev/null +++ b/extensions/dacpac/package.json @@ -0,0 +1,49 @@ +{ + "name": "dacpac", + "displayName": "SQL Server Dacpac", + "description": "SQL Server Dacpac for Azure Data Studio.", + "version": "0.1.0", + "publisher": "Microsoft", + "preview": true, + "engines": { + "vscode": "^1.25.0", + "sqlops": "*" + }, + "license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt", + "icon": "images/sqlserver.png", + "aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412", + "activationEvents": [ + "*" + ], + "main": "./out/main", + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/azuredatastudio.git" + }, + "extensionDependencies": [ + "Microsoft.mssql" + ], + "contributes": { + "commands": [ + { + "command": "dacFx.start", + "title": "Data-tier Application wizard", + "category": "Data-tier Application" + } + ], + "menus": { + "objectExplorer/item/context": [ + { + "command": "dacFx.start", + "when": "connectionProvider == MSSQL && nodeType && nodeType == Database", + "group": "export" + } + ] + } + }, + "dependencies": { + "htmlparser2": "^3.10.1", + "vscode-nls": "^3.2.1" + }, + "devDependencies": {} +} diff --git a/extensions/dacpac/src/controllers/controllerBase.ts b/extensions/dacpac/src/controllers/controllerBase.ts new file mode 100644 index 0000000000..fb4a2e8920 --- /dev/null +++ b/extensions/dacpac/src/controllers/controllerBase.ts @@ -0,0 +1,30 @@ + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as vscode from 'vscode'; + +export default abstract class ControllerBase implements vscode.Disposable { + protected _context: vscode.ExtensionContext; + + protected constructor(context: vscode.ExtensionContext) { + this._context = context; + } + + public get extensionContext(): vscode.ExtensionContext { + return this._context; + } + + abstract activate(): Promise; + + abstract deactivate(): void; + + public dispose(): void { + this.deactivate(); + } +} + diff --git a/extensions/dacpac/src/controllers/mainController.ts b/extensions/dacpac/src/controllers/mainController.ts new file mode 100644 index 0000000000..32dcab6751 --- /dev/null +++ b/extensions/dacpac/src/controllers/mainController.ts @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as azdata from 'azdata'; +import ControllerBase from './controllerBase'; +import * as vscode from 'vscode'; +import { DataTierApplicationWizard } from '../wizard/dataTierApplicationWizard'; + +/** + * The main controller class that initializes the extension + */ +export default class MainController extends ControllerBase { + + public constructor(context: vscode.ExtensionContext) { + super(context); + } + /** + */ + public deactivate(): void { + } + + public activate(): Promise { + this.initializeDacFxWizard(); + return Promise.resolve(true); + } + + private initializeDacFxWizard() { + azdata.tasks.registerTask('dacFx.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new DataTierApplicationWizard().start(profile, args)); + } +} diff --git a/extensions/dacpac/src/main.ts b/extensions/dacpac/src/main.ts new file mode 100644 index 0000000000..cac1908f61 --- /dev/null +++ b/extensions/dacpac/src/main.ts @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; +import * as vscode from 'vscode'; + +import ControllerBase from './controllers/controllerBase'; +import MainController from './controllers/mainController'; + +let controllers: ControllerBase[] = []; + +export function activate(context: vscode.ExtensionContext) { + let activations: Promise[] = []; + + // Start the main controller + let mainController = new MainController(context); + controllers.push(mainController); + context.subscriptions.push(mainController); + activations.push(mainController.activate()); + + return Promise.all(activations) + .then((results: boolean[]) => { + for (let result of results) { + if (!result) { + return false; + } + } + return true; + }); +} + +export function deactivate() { + for (let controller of controllers) { + controller.deactivate(); + } +} diff --git a/extensions/dacpac/src/typings/ref.d.ts b/extensions/dacpac/src/typings/ref.d.ts new file mode 100644 index 0000000000..1c00f76a98 --- /dev/null +++ b/extensions/dacpac/src/typings/ref.d.ts @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/// +/// +/// +/// +/// +/// \ No newline at end of file diff --git a/extensions/dacpac/src/wizard/api/basePage.ts b/extensions/dacpac/src/wizard/api/basePage.ts new file mode 100644 index 0000000000..c462745733 --- /dev/null +++ b/extensions/dacpac/src/wizard/api/basePage.ts @@ -0,0 +1,139 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as azdata from 'azdata'; +import { DacFxDataModel } from './models'; + +export abstract class BasePage { + + protected readonly wizardPage: azdata.window.modelviewdialog.WizardPage; + protected readonly model: DacFxDataModel; + protected readonly view: azdata.ModelView; + + /** + * This method constructs all the elements of the page. + * @returns {Promise} + */ + public async abstract start(): Promise; + + /** + * This method is called when the user is entering the page. + * @returns {Promise} + */ + public async abstract onPageEnter(): Promise; + + /** + * This method is called when the user is leaving the page. + * @returns {Promise} + */ + async onPageLeave(): Promise { + return true; + } + + /** + * Override this method to cleanup what you don't need cached in the page. + * @returns {Promise} + */ + public async cleanup(): Promise { + return true; + } + + /** + * Sets up a navigation validator. + * This will be called right before onPageEnter(). + */ + public abstract setupNavigationValidator(); + + protected async getServerValues(): Promise<{ connection, displayName, name }[]> { + let cons = await azdata.connection.getActiveConnections(); + // This user has no active connections ABORT MISSION + if (!cons || cons.length === 0) { + return undefined; + } + + let count = -1; + let idx = -1; + + + let values = cons.map(c => { + // Handle the code to remember what the user's choice was from before + count++; + if (idx === -1) { + if (this.model.server && c.connectionId === this.model.server.connectionId) { + idx = count; + } else if (this.model.serverId && c.connectionId === this.model.serverId) { + idx = count; + } + } + + let db = c.options.databaseDisplayName; + let usr = c.options.user; + let srv = c.options.server; + + if (!db) { + db = ''; + } + + if (!usr) { + usr = 'default'; + } + + let finalName = `${srv}, ${db} (${usr})`; + return { + connection: c, + displayName: finalName, + name: c.connectionId + }; + }); + + if (idx >= 0) { + let tmp = values[0]; + values[0] = values[idx]; + values[idx] = tmp; + } else { + this.deleteServerValues(); + } + + return values; + } + + protected async getDatabaseValues(): Promise<{ displayName, name }[]> { + let idx = -1; + let count = -1; + let values = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => { + count++; + if (this.model.database && db === this.model.database) { + idx = count; + } + + return { + displayName: db, + name: db + }; + }); + + if (idx >= 0) { + let tmp = values[0]; + values[0] = values[idx]; + values[idx] = tmp; + } else { + this.deleteDatabaseValues(); + } + + return values; + } + + protected deleteServerValues() { + delete this.model.server; + delete this.model.serverId; + delete this.model.database; + } + + protected deleteDatabaseValues() { + return; + } +} + diff --git a/extensions/import/src/wizard/api/dacFxConfigPage.ts b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts similarity index 100% rename from extensions/import/src/wizard/api/dacFxConfigPage.ts rename to extensions/dacpac/src/wizard/api/dacFxConfigPage.ts diff --git a/extensions/dacpac/src/wizard/api/models.ts b/extensions/dacpac/src/wizard/api/models.ts new file mode 100644 index 0000000000..ddad104b02 --- /dev/null +++ b/extensions/dacpac/src/wizard/api/models.ts @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as azdata from 'azdata'; + +/** + * Data model to communicate between DacFx pages + */ +export interface DacFxDataModel { + server: azdata.connection.Connection; + database: string; + serverName: string; + serverId: string; + filePath: string; + version: string; + upgradeExisting: boolean; + scriptFilePath: string; + generateScriptAndDeploy: boolean; +} diff --git a/extensions/import/src/wizard/dataTierApplicationWizard.ts b/extensions/dacpac/src/wizard/dataTierApplicationWizard.ts similarity index 100% rename from extensions/import/src/wizard/dataTierApplicationWizard.ts rename to extensions/dacpac/src/wizard/dataTierApplicationWizard.ts diff --git a/extensions/import/src/wizard/pages/dacFxSummaryPage.ts b/extensions/dacpac/src/wizard/pages/dacFxSummaryPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/dacFxSummaryPage.ts rename to extensions/dacpac/src/wizard/pages/dacFxSummaryPage.ts diff --git a/extensions/import/src/wizard/pages/deployActionPage.ts b/extensions/dacpac/src/wizard/pages/deployActionPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/deployActionPage.ts rename to extensions/dacpac/src/wizard/pages/deployActionPage.ts diff --git a/extensions/import/src/wizard/pages/deployConfigPage.ts b/extensions/dacpac/src/wizard/pages/deployConfigPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/deployConfigPage.ts rename to extensions/dacpac/src/wizard/pages/deployConfigPage.ts diff --git a/extensions/import/src/wizard/pages/deployPlanPage.ts b/extensions/dacpac/src/wizard/pages/deployPlanPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/deployPlanPage.ts rename to extensions/dacpac/src/wizard/pages/deployPlanPage.ts diff --git a/extensions/import/src/wizard/pages/exportConfigPage.ts b/extensions/dacpac/src/wizard/pages/exportConfigPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/exportConfigPage.ts rename to extensions/dacpac/src/wizard/pages/exportConfigPage.ts diff --git a/extensions/import/src/wizard/pages/extractConfigPage.ts b/extensions/dacpac/src/wizard/pages/extractConfigPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/extractConfigPage.ts rename to extensions/dacpac/src/wizard/pages/extractConfigPage.ts diff --git a/extensions/import/src/wizard/pages/importConfigPage.ts b/extensions/dacpac/src/wizard/pages/importConfigPage.ts similarity index 100% rename from extensions/import/src/wizard/pages/importConfigPage.ts rename to extensions/dacpac/src/wizard/pages/importConfigPage.ts diff --git a/extensions/import/src/wizard/pages/selectOperationpage.ts b/extensions/dacpac/src/wizard/pages/selectOperationpage.ts similarity index 100% rename from extensions/import/src/wizard/pages/selectOperationpage.ts rename to extensions/dacpac/src/wizard/pages/selectOperationpage.ts diff --git a/extensions/dacpac/tsconfig.json b/extensions/dacpac/tsconfig.json new file mode 100644 index 0000000000..e6baa6d40d --- /dev/null +++ b/extensions/dacpac/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "./out", + "lib": [ + "es6", "es2015.promise" + ], + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "declaration": true + }, + "exclude": [ + "node_modules" + ] +} diff --git a/extensions/dacpac/yarn.lock b/extensions/dacpac/yarn.lock new file mode 100644 index 0000000000..568b64df58 --- /dev/null +++ b/extensions/dacpac/yarn.lock @@ -0,0 +1,84 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +dom-serializer@0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + +entities@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + +htmlparser2@^3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + +inherits@^2.0.1, inherits@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +readable-stream@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d" + integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +safe-buffer@~5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +vscode-nls@^3.2.1: + version "3.2.5" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4" + integrity sha512-ITtoh3V4AkWXMmp3TB97vsMaHRgHhsSFPsUdzlueSL+dRZbSNTZeOmdQv60kjCV306ghPxhDeoNUEm3+EZMuyw== diff --git a/extensions/import/README.md b/extensions/import/README.md index 7a5d7d988b..ed3b58bb6c 100644 --- a/extensions/import/README.md +++ b/extensions/import/README.md @@ -1,8 +1,7 @@ # Microsoft SQL Server Import for Azure Data Studio -Microsoft SQL Server Import for Azure Data Studio includes two wizards: +Microsoft SQL Server Import for Azure Data Studio includes the wizard: - [Import Flat File Wizard](#import-flat-file-wizard-preview) -- [Data-tier Application Wizard.](#data-tier-application-wizard-preview) ## Import Flat File Wizard *(preview)* **The Import Flat File Wizard** is a simple way to copy data from a flat file (.csv, .txt, .json) to a SQL Server table. Checkout below the reasons for using the Import Flat File wizard, how to find this wizard, and a simple example. @@ -24,25 +23,6 @@ This wizard was created to improve the current import experience leveraging an i PROSE analyzes data patterns in your input file to infer column names, types, delimiters, and more. This framework learns the structure of the file and does all of the hard work so users don't have to. Please note that the PROSE binary components used by this extension are licensed under the [MICROSOFT SQL TOOLS IMPORT FLAT FILE EULA](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/extensions/import/Microsoft_SQL_Server_Import_Extension_and_Tools_Import_Flat_File_Preview.docx). - -## Data-tier Application Wizard *(preview)* -**The Data-tier Application Wizard** provides an easy to use experience to deploy and extract .dacpac files and import and export .bacpac files. - -This experience is currently in its initial preview. Please report issues and feature requests [here.](https://github.com/microsoft/azuredatastudio/issues) - - - - ### Requirements - * This wizard requires an active connection to a SQL Server instance to start. - - ### How do I start the Data-tier Application wizard? - * The main entry point for the wizard is to right click a database in the Object Explorer, and click **Data-tier Application wizard**. - * If a user is connected to a SQL Server instance, the user can also start the wizard from the command palette (Ctrl+Shift+P) by searching for **Data-tier Application wizard.** - - ### Why would I use the Data-tier Application wizard? - This wizard was created to add the ability to extract and deploy .dacpac files and import and export .bacpac files in Azure Data Studio. - -To learn more about Data-Tier Applications and working with dacpac and bacpac files, [you can read more here.](https://docs.microsoft.com/en-us/sql/relational-databases/data-tier-applications/data-tier-applications?view=sql-server-2017) ## License diff --git a/extensions/import/package.json b/extensions/import/package.json index f551087bb7..bc8127d26b 100644 --- a/extensions/import/package.json +++ b/extensions/import/package.json @@ -2,7 +2,7 @@ "name": "import", "displayName": "SQL Server Import", "description": "SQL Server Import for Azure Data Studio supports importing CSV or JSON files into SQL Server.", - "version": "0.6.1", + "version": "0.7.0", "publisher": "Microsoft", "preview": true, "engines": { @@ -33,15 +33,6 @@ "light": "./images/light_icon.svg", "dark": "./images/dark_icon.svg" } - }, - { - "command": "dacFx.start", - "title": "Data-tier Application Wizard", - "category": "Data-tier Application", - "icon": { - "light": "./images/light_icon.svg", - "dark": "./images/dark_icon.svg" - } } ], "keybindings": [ @@ -57,11 +48,6 @@ "command": "flatFileImport.start", "when": "connectionProvider == MSSQL && nodeType && nodeType == Database", "group": "import" - }, - { - "command": "dacFx.start", - "when": "connectionProvider == MSSQL && nodeType && nodeType == Database", - "group": "export" } ] } diff --git a/extensions/import/src/controllers/mainController.ts b/extensions/import/src/controllers/mainController.ts index 5769fb6f3e..0afa738898 100644 --- a/extensions/import/src/controllers/mainController.ts +++ b/extensions/import/src/controllers/mainController.ts @@ -13,7 +13,6 @@ import { FlatFileWizard } from '../wizard/flatFileWizard'; import { ServiceClient } from '../services/serviceClient'; import { ApiType, managerInstance } from '../services/serviceApiManager'; import { FlatFileProvider } from '../services/contracts'; -import { DataTierApplicationWizard } from '../wizard/dataTierApplicationWizard'; /** * The main controller class that initializes the extension @@ -36,15 +35,10 @@ export default class MainController extends ControllerBase { this.initializeFlatFileProvider(provider); }); - this.initializeDacFxWizard(); return Promise.resolve(true); } private initializeFlatFileProvider(provider: FlatFileProvider) { azdata.tasks.registerTask('flatFileImport.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new FlatFileWizard(provider).start(profile, args)); } - - private initializeDacFxWizard() { - azdata.tasks.registerTask('dacFx.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new DataTierApplicationWizard().start(profile, args)); - } } diff --git a/extensions/import/src/wizard/api/basePage.ts b/extensions/import/src/wizard/api/basePage.ts index 5c1f857366..86c6bc0803 100644 --- a/extensions/import/src/wizard/api/basePage.ts +++ b/extensions/import/src/wizard/api/basePage.ts @@ -5,12 +5,12 @@ 'use strict'; import * as azdata from 'azdata'; -import { BaseDataModel } from './models'; +import { ImportDataModel } from './models'; export abstract class BasePage { protected readonly wizardPage: azdata.window.WizardPage; - protected readonly model: BaseDataModel; + protected readonly model: ImportDataModel; protected readonly view: azdata.ModelView; /** diff --git a/extensions/import/src/wizard/api/models.ts b/extensions/import/src/wizard/api/models.ts index 5051df192e..c008f8f1ee 100644 --- a/extensions/import/src/wizard/api/models.ts +++ b/extensions/import/src/wizard/api/models.ts @@ -6,16 +6,12 @@ import * as azdata from 'azdata'; -export interface BaseDataModel { - server: azdata.connection.Connection; - serverId: string; - database: string; -} - /** * The main data model that communicates between the pages. */ -export interface ImportDataModel extends BaseDataModel { +export interface ImportDataModel { + server: azdata.connection.Connection; + serverId: string; ownerUri: string; proseColumns: ColumnMetadata[]; proseDataPreview: string[][]; @@ -35,16 +31,3 @@ export interface ColumnMetadata { primaryKey: boolean; nullable: boolean; } - -/** - * Data model to communicate between DacFx pages - */ -export interface DacFxDataModel extends BaseDataModel { - serverName: string; - serverId: string; - filePath: string; - version: string; - upgradeExisting: boolean; - scriptFilePath: string; - generateScriptAndDeploy: boolean; -}