mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Add launchPublishToDockerContainerQuickpick to extension API (#19834)
* Initial * remove namespace * minor fixes
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DeploymentOptions as mssqlDeploymentOptions } from 'mssql';
|
||||
import { DeploymentOptions as vscodeMssqlDeploymentOptions } from 'vscode-mssql';
|
||||
|
||||
export type DeploymentOptions = mssqlDeploymentOptions | vscodeMssqlDeploymentOptions;
|
||||
|
||||
export interface IDeploySettings {
|
||||
databaseName: string;
|
||||
serverName: string;
|
||||
connectionUri: string;
|
||||
sqlCmdVariables?: Record<string, string>;
|
||||
deploymentOptions?: DeploymentOptions;
|
||||
profileUsed?: boolean;
|
||||
}
|
||||
@@ -8,18 +8,7 @@ import * as utils from '../../common/utils';
|
||||
import * as vscode from 'vscode';
|
||||
import { ConnectionResult } from 'azdata';
|
||||
import { IFireWallRuleError } from 'vscode-mssql';
|
||||
|
||||
export interface ISqlConnectionProperties {
|
||||
tenantId?: string,
|
||||
accountId?: string
|
||||
serverName: string,
|
||||
userName: string,
|
||||
password: string,
|
||||
port: number,
|
||||
dbName: string,
|
||||
profileName?: string,
|
||||
connectionRetryTimeout?: number
|
||||
}
|
||||
import { ISqlConnectionProperties } from 'sqldbproj';
|
||||
|
||||
/**
|
||||
* Includes methods to open connections and interact with connection views
|
||||
|
||||
@@ -3,19 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDeploySettings } from '../IDeploySettings';
|
||||
import type * as azdataType from 'azdata';
|
||||
import { IDeploySettings, ISqlConnectionProperties } from 'sqldbproj';
|
||||
import { IAzureAccountSession } from 'vscode-mssql';
|
||||
import { ISqlConnectionProperties } from '../connections/connectionService';
|
||||
|
||||
export enum AppSettingType {
|
||||
None,
|
||||
AzureFunction
|
||||
}
|
||||
export interface ILocalDbDeployProfile {
|
||||
localDbSetting?: ILocalDbSetting;
|
||||
deploySettings?: IDeploySettings;
|
||||
}
|
||||
|
||||
export interface ISqlDbDeployProfile {
|
||||
sqlDbSetting?: ISqlDbSetting;
|
||||
@@ -34,13 +29,6 @@ export interface ISqlDbSetting extends ISqlConnectionProperties {
|
||||
location: string
|
||||
}
|
||||
|
||||
export interface ILocalDbSetting extends ISqlConnectionProperties {
|
||||
dockerBaseImage: string,
|
||||
dockerBaseImageEula: string,
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface DockerImageInfo {
|
||||
name: string,
|
||||
displayName: string,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ILocalDbDeployProfile, ILocalDbSetting, ISqlDbDeployProfile } from './deployProfile';
|
||||
import { ISqlDbDeployProfile } from './deployProfile';
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
import { Project } from '../project';
|
||||
import * as constants from '../../common/constants';
|
||||
@@ -12,6 +12,7 @@ import * as vscode from 'vscode';
|
||||
import { ShellExecutionHelper } from '../../tools/shellExecutionHelper';
|
||||
import { AzureSqlClient } from './azureSqlClient';
|
||||
import { ConnectionService } from '../connections/connectionService';
|
||||
import { ILocalDbSetting, IPublishToDockerSettings } from 'sqldbproj';
|
||||
|
||||
interface DockerImageSpec {
|
||||
label: string;
|
||||
@@ -89,7 +90,7 @@ export class DeployService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public async deployToContainer(profile: ILocalDbDeployProfile, project: Project): Promise<string | undefined> {
|
||||
public async deployToContainer(profile: IPublishToDockerSettings, project: Project): Promise<string | undefined> {
|
||||
return await this.executeTask(constants.deployDbTaskName, async () => {
|
||||
if (!profile.localDbSetting) {
|
||||
return undefined;
|
||||
|
||||
@@ -12,12 +12,12 @@ import * as os from 'os';
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
|
||||
import { Uri, window } from 'vscode';
|
||||
import { ISqlProject, ItemType, SqlTargetPlatform } from 'sqldbproj';
|
||||
import { EntryType, IDatabaseReferenceProjectEntry, IProjectEntry, ISqlProject, ItemType, SqlTargetPlatform } from 'sqldbproj';
|
||||
import { promises as fs } from 'fs';
|
||||
import { DataSource } from './dataSources/dataSources';
|
||||
import { ISystemDatabaseReferenceSettings, IDacpacReferenceSettings, IProjectReferenceSettings } from './IDatabaseReferenceSettings';
|
||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||
import { DacpacReferenceProjectEntry, EntryType, FileProjectEntry, IDatabaseReferenceProjectEntry, ProjectEntry, SqlCmdVariableProjectEntry, SqlProjectReferenceProjectEntry, SystemDatabase, SystemDatabaseReferenceProjectEntry } from './projectEntry';
|
||||
import { DacpacReferenceProjectEntry, FileProjectEntry, ProjectEntry, SqlCmdVariableProjectEntry, SqlProjectReferenceProjectEntry, SystemDatabase, SystemDatabaseReferenceProjectEntry } from './projectEntry';
|
||||
|
||||
/**
|
||||
* Class representing a Project, and providing functions for operating on it
|
||||
@@ -1625,8 +1625,8 @@ export class Project implements ISqlProject {
|
||||
await this.serializeToProjFile(this.projFileXmlDoc!);
|
||||
}
|
||||
|
||||
private async removeFromProjFile(entries: ProjectEntry | ProjectEntry[]): Promise<void> {
|
||||
if (entries instanceof ProjectEntry) {
|
||||
private async removeFromProjFile(entries: IProjectEntry | IProjectEntry[]): Promise<void> {
|
||||
if (!Array.isArray(entries)) {
|
||||
entries = [entries];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,18 +6,15 @@
|
||||
import * as path from 'path';
|
||||
import * as utils from '../common/utils';
|
||||
import { IDacpacReferenceSettings, IProjectReferenceSettings } from './IDatabaseReferenceSettings';
|
||||
import { IFileProjectEntry } from 'sqldbproj';
|
||||
import { EntryType, IDatabaseReferenceProjectEntry, IFileProjectEntry, IProjectEntry } from 'sqldbproj';
|
||||
import { Uri } from 'vscode';
|
||||
|
||||
/**
|
||||
* Represents an entry in a project file
|
||||
*/
|
||||
export abstract class ProjectEntry {
|
||||
type: EntryType;
|
||||
export abstract class ProjectEntry implements IProjectEntry {
|
||||
|
||||
constructor(type: EntryType) {
|
||||
this.type = type;
|
||||
}
|
||||
constructor(public type: EntryType) { }
|
||||
}
|
||||
|
||||
export class FileProjectEntry extends ProjectEntry implements IFileProjectEntry {
|
||||
@@ -46,16 +43,6 @@ export class FileProjectEntry extends ProjectEntry implements IFileProjectEntry
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a database reference entry in a project file
|
||||
*/
|
||||
|
||||
export interface IDatabaseReferenceProjectEntry extends FileProjectEntry {
|
||||
databaseName: string;
|
||||
databaseVariableLiteralValue?: string;
|
||||
suppressMissingDependenciesErrors: boolean;
|
||||
}
|
||||
|
||||
export class DacpacReferenceProjectEntry extends FileProjectEntry implements IDatabaseReferenceProjectEntry {
|
||||
databaseVariableLiteralValue?: string;
|
||||
databaseSqlCmdVariable?: string;
|
||||
@@ -144,13 +131,6 @@ export class SqlCmdVariableProjectEntry extends ProjectEntry {
|
||||
}
|
||||
}
|
||||
|
||||
export enum EntryType {
|
||||
File,
|
||||
Folder,
|
||||
DatabaseReference,
|
||||
SqlCmdVariable
|
||||
}
|
||||
|
||||
export enum DatabaseReferenceLocation {
|
||||
sameDatabase,
|
||||
differentDatabaseSameServer,
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as constants from '../../common/constants';
|
||||
import { BaseProjectTreeItem } from './baseTreeItem';
|
||||
import { ProjectRootTreeItem } from './projectTreeItem';
|
||||
import { IconPathHelper } from '../../common/iconHelper';
|
||||
import { IDatabaseReferenceProjectEntry } from '../projectEntry';
|
||||
import { IDatabaseReferenceProjectEntry } from 'sqldbproj';
|
||||
|
||||
/**
|
||||
* Folder for containing references nodes in the tree
|
||||
|
||||
@@ -13,7 +13,8 @@ import * as utils from '../../common/utils';
|
||||
import { DatabaseReferencesTreeItem } from './databaseReferencesTreeItem';
|
||||
import { DatabaseProjectItemType, RelativeOuterPath, ExternalStreamingJob, sqlprojExtension } from '../../common/constants';
|
||||
import { IconPathHelper } from '../../common/iconHelper';
|
||||
import { EntryType, FileProjectEntry } from '../projectEntry';
|
||||
import { FileProjectEntry } from '../projectEntry';
|
||||
import { EntryType } from 'sqldbproj';
|
||||
|
||||
/**
|
||||
* TreeNode root that represents an entire project
|
||||
|
||||
Reference in New Issue
Block a user