mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-06 19:40:13 +00:00
Feat: support oceanbase monaco plugin (#1386)
This commit is contained in:
21
web/components/chat/ob-editor/service.ts
Normal file
21
web/components/chat/ob-editor/service.ts
Normal 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() || []
|
||||
},
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user