mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 23:05:29 +08:00
refactor(plugin-sql-editor): CB-2093 memory data source
This commit is contained in:
@@ -12,7 +12,7 @@ import { NotificationService } from '@cloudbeaver/core-events';
|
||||
import { IExecutor, Executor, IExecutionContextProvider } from '@cloudbeaver/core-executor';
|
||||
import { NavigationService } from '@cloudbeaver/core-ui';
|
||||
import { uuid } from '@cloudbeaver/core-utils';
|
||||
import { ISqlEditorTabState, SqlResultTabsService } from '@cloudbeaver/plugin-sql-editor';
|
||||
import { ISqlEditorTabState, MemorySqlDataSource, SqlResultTabsService } from '@cloudbeaver/plugin-sql-editor';
|
||||
|
||||
import { SQL_EDITOR_SOURCE_ACTION } from './SQL_EDITOR_SOURCE_ACTION';
|
||||
import { SqlEditorTabService, isSQLEditorTab } from './SqlEditorTabService';
|
||||
@@ -28,6 +28,7 @@ export interface SQLEditorActionContext {
|
||||
}
|
||||
|
||||
export interface ISQLEditorOptions {
|
||||
dataSourceKey?: string;
|
||||
name?: string;
|
||||
connectionId?: string;
|
||||
catalogId?: string;
|
||||
@@ -111,6 +112,7 @@ export class SqlEditorNavigatorService {
|
||||
|
||||
const tabOptions = this.sqlEditorTabService.createNewEditor(
|
||||
editorId,
|
||||
data.dataSourceKey ?? MemorySqlDataSource.key,
|
||||
data.name,
|
||||
data.source,
|
||||
data.query,
|
||||
|
||||
@@ -103,6 +103,7 @@ export class SqlEditorTabService extends Bootstrap {
|
||||
|
||||
createNewEditor(
|
||||
editorId: string,
|
||||
dataSourceKey: string,
|
||||
name?: string,
|
||||
source?: string,
|
||||
query?: string,
|
||||
@@ -113,7 +114,15 @@ export class SqlEditorTabService extends Bootstrap {
|
||||
return {
|
||||
id: editorId,
|
||||
handlerId: sqlEditorTabHandlerKey,
|
||||
handlerState: this.sqlEditorService.getState(editorId, order, name, source, query, undefined),
|
||||
handlerState: this.sqlEditorService.getState(
|
||||
editorId,
|
||||
dataSourceKey,
|
||||
order,
|
||||
name,
|
||||
source,
|
||||
query,
|
||||
undefined
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user