Files
cloudbeaver/webapp/packages/plugin-sql-editor/src/SqlDataSource/ISqlDataSource.ts
T
Alexeyanddariamarutkina 78c19187de Feat CB-3030 conflict resolving (#1814)
* CB-3030 feat: conflict resolving

* CB-3030 fix: display os specific key instead of mod

* CB-3030 fix: sql editor status

* CB-3030 fix: styles and data validation

* CB-3030 fix: sql editor styles

---------

Co-authored-by: dariamarutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-07-17 22:10:15 +03:00

69 lines
2.6 KiB
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2023 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import type { IConnectionExecutionContextInfo } from '@cloudbeaver/core-connections';
import type { ISyncExecutor } from '@cloudbeaver/core-executor';
import type { ILoadableState } from '@cloudbeaver/core-utils';
import type { IDatabaseDataModel, IDatabaseResultSet } from '@cloudbeaver/plugin-data-viewer';
import type { IDataQueryOptions } from '../QueryDataSource';
import type { ESqlDataSourceFeatures } from './ESqlDataSourceFeatures';
import type { ISqlDataSourceHistory } from './SqlDataSourceHistory/ISqlDataSourceHistory';
export interface ISqlDataSourceKey {
readonly key: string;
}
export interface ISetScriptData {
script: string;
source?: string;
}
export interface ISqlDataSource extends ILoadableState {
readonly sourceKey: string;
readonly name: string | null;
readonly icon?: string;
readonly emptyPlaceholder?: string;
readonly script: string;
readonly incomingScript?: string;
readonly projectId: string | null;
readonly databaseModels: IDatabaseDataModel<IDataQueryOptions, IDatabaseResultSet>[];
readonly executionContext?: IConnectionExecutionContextInfo;
readonly message?: string;
readonly onUpdate: ISyncExecutor;
readonly onSetScript: ISyncExecutor<ISetScriptData>;
readonly onDatabaseModelUpdate: ISyncExecutor<IDatabaseDataModel<IDataQueryOptions, IDatabaseResultSet>[]>;
readonly features: ESqlDataSourceFeatures[];
readonly history: ISqlDataSourceHistory;
readonly isAutoSaveEnabled: boolean;
readonly isIncomingChanges: boolean;
readonly isSaved: boolean;
readonly isScriptSaved: boolean;
readonly isExecutionContextSaved: boolean;
isReadonly(): boolean;
isEditing(): boolean;
isOutdated(): boolean;
markOutdated(): void;
markUpdated(): void;
hasFeature(feature: ESqlDataSourceFeatures): boolean;
canRename(name: string | null): boolean;
setName(name: string | null): void;
setProject(projectId: string | null): void;
setScript(script: string, source?: string): void;
setEditing(state: boolean): void;
setExecutionContext(executionContext?: IConnectionExecutionContextInfo): void;
setIncomingExecutionContext(executionContext?: IConnectionExecutionContextInfo): void;
setIncomingScript(script?: string): void;
applyIncoming(): void;
keepCurrent(): void;
save(): Promise<void> | void;
load(): Promise<void> | void;
reset(): Promise<void> | void;
dispose(): Promise<void> | void;
}