Feat: support oceanbase monaco plugin (#1386)

This commit is contained in:
Xiao Kang
2024-04-13 23:55:33 +08:00
committed by GitHub
parent f3ece627d0
commit 53438a368b
8 changed files with 2423 additions and 62 deletions

View File

@@ -0,0 +1,21 @@
import type { IModelOptions } from '@oceanbase-odc/monaco-plugin-ob/dist/type';
import { ISession } from '../monaco-editor';
export function getModelService(
{ modelId, delimiter }: { modelId: string; delimiter: string },
session?: () => ISession | null
): IModelOptions {
return {
delimiter,
async getTableList(schemaName?: string) {
return session?.()?.getTableList(schemaName) || []
},
async getTableColumns(tableName: string, dbName?: string) {
return session?.()?.getTableColumns(tableName) || []
},
async getSchemaList() {
return session?.()?.getSchemaList() || []
},
};
}