UNPKG

@godspeedsystems/plugins-text-to-sql-as-datasource

Version:

text-to-sql as datasource plugin for Godspeed Framework

74 lines (73 loc) 2.27 kB
import { GSContext, GSDataSource, PlainObject } from '@godspeedsystems/core'; export default class MultiDBTextToSQLDataSource extends GSDataSource { private genAI; private model; private dbManager; private connections; private redisClient; private schemas; protected initClient(): Promise<object>; private initializeDatabases; private fetchDatabaseSchema; private fetchPostgresSchema; private fetchMySQLSchema; private fetchMongoSchema; private fetchOracleSchema; private formatRelationalSchema; private formatMongoSchema; private formatOracleSchema; execute(ctx: GSContext, args: PlainObject): Promise<any>; private generateQuery; private executeQuery; private cacheQuery; private getCachedQuery; cleanup(): Promise<void>; } declare const SourceType = "DS"; declare const Type = "text-to-sql"; declare const CONFIG_FILE_NAME = "text-to-sql"; declare const DEFAULT_CONFIG: { gemini: { apiKey: string | undefined; }; databases: { postgres: { enabled: boolean; config: { user: string | undefined; host: string | undefined; database: string | undefined; password: string | undefined; port: number; }; }; mysql: { enabled: boolean; config: { host: string | undefined; user: string | undefined; password: string | undefined; database: string | undefined; }; }; mongodb: { enabled: boolean; config: { url: string | undefined; database: string | undefined; }; }; oracle: { enabled: boolean; config: { user: string | undefined; password: string | undefined; connectString: string | undefined; }; }; }; redis: { url: string | undefined; }; }; export { MultiDBTextToSQLDataSource as DataSource, SourceType, Type, CONFIG_FILE_NAME, DEFAULT_CONFIG, };