Register mysql, pgsql with mssql as default 'sql' kernel providers (#22729)

This commit is contained in:
Cheena Malhotra
2023-04-18 22:07:02 -07:00
committed by GitHub
parent 47a1745180
commit ba694a0558
4 changed files with 10 additions and 3 deletions

View File

@@ -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';

View File

@@ -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,

View File

@@ -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]);
} }

View File

@@ -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]
}] }]
}); });