mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Register mysql, pgsql with mssql as default 'sql' kernel providers (#22729)
This commit is contained in:
@@ -11,6 +11,7 @@ export const outputChannelName = 'MSSQL';
|
|||||||
export const capabilitiesOptions = 'OPTIONS_METADATA';
|
export const capabilitiesOptions = 'OPTIONS_METADATA';
|
||||||
|
|
||||||
export const mssqlProviderName = 'MSSQL';
|
export const mssqlProviderName = 'MSSQL';
|
||||||
|
export const mysqlProviderName = 'MYSQL';
|
||||||
export const pgsqlProviderName = 'PGSQL';
|
export const pgsqlProviderName = 'PGSQL';
|
||||||
export const anyProviderName = '*';
|
export const anyProviderName = '*';
|
||||||
export const connectionProviderContextKey = 'connectionProvider';
|
export const connectionProviderContextKey = 'connectionProvider';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { nb } from 'azdata';
|
import { nb } from 'azdata';
|
||||||
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
import { mssqlProviderName, mysqlProviderName, pgsqlProviderName } from 'sql/platform/connection/common/constants';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
|
|
||||||
export interface FutureInternal extends nb.IFuture {
|
export interface FutureInternal extends nb.IFuture {
|
||||||
@@ -14,6 +14,8 @@ export interface FutureInternal extends nb.IFuture {
|
|||||||
export namespace notebookConstants {
|
export namespace notebookConstants {
|
||||||
export const SQL = 'SQL';
|
export const SQL = 'SQL';
|
||||||
export const SQL_CONNECTION_PROVIDER = mssqlProviderName;
|
export const SQL_CONNECTION_PROVIDER = mssqlProviderName;
|
||||||
|
export const MYSQL_CONNECTION_PROVIDER = mysqlProviderName;
|
||||||
|
export const PGSQL_CONNECTION_PROVIDER = pgsqlProviderName;
|
||||||
export const sqlKernel: string = localize('sqlKernel', "SQL");
|
export const sqlKernel: string = localize('sqlKernel', "SQL");
|
||||||
export const sqlKernelSpec: nb.IKernelSpec = ({
|
export const sqlKernelSpec: nb.IKernelSpec = ({
|
||||||
name: sqlKernel,
|
name: sqlKernel,
|
||||||
|
|||||||
@@ -1121,7 +1121,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
|||||||
// Switching from Kusto to another kernel should set the currentKernelAlias to undefined
|
// Switching from Kusto to another kernel should set the currentKernelAlias to undefined
|
||||||
if (this._selectedKernelDisplayName !== this._currentKernelAlias && this._selectedKernelDisplayName) {
|
if (this._selectedKernelDisplayName !== this._currentKernelAlias && this._selectedKernelDisplayName) {
|
||||||
this._currentKernelAlias = undefined;
|
this._currentKernelAlias = undefined;
|
||||||
} else {
|
} else if (this._currentKernelAlias) {
|
||||||
// Adds Kernel Alias and Connection Provider to Map if new Notebook connection contains notebookKernelAlias
|
// Adds Kernel Alias and Connection Provider to Map if new Notebook connection contains notebookKernelAlias
|
||||||
this._kernelDisplayNameToConnectionProviderIds.set(this._currentKernelAlias, [profile.providerName]);
|
this._kernelDisplayNameToConnectionProviderIds.set(this._currentKernelAlias, [profile.providerName]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -909,7 +909,11 @@ export class NotebookService extends Disposable implements INotebookService {
|
|||||||
standardKernels: [{
|
standardKernels: [{
|
||||||
name: notebookConstants.SQL,
|
name: notebookConstants.SQL,
|
||||||
displayName: notebookConstants.SQL,
|
displayName: notebookConstants.SQL,
|
||||||
connectionProviderIds: [notebookConstants.SQL_CONNECTION_PROVIDER],
|
connectionProviderIds: [
|
||||||
|
notebookConstants.SQL_CONNECTION_PROVIDER,
|
||||||
|
notebookConstants.MYSQL_CONNECTION_PROVIDER,
|
||||||
|
notebookConstants.PGSQL_CONNECTION_PROVIDER
|
||||||
|
],
|
||||||
supportedLanguages: [notebookConstants.sqlKernelSpec.language]
|
supportedLanguages: [notebookConstants.sqlKernelSpec.language]
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user