mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-22 09:28:42 +00:00
34 lines
859 B
Python
34 lines
859 B
Python
#!/usr/bin/env python3
|
|
# -*- coding:utf-8 -*-
|
|
|
|
"""We need to design a base class. That other connector can Write with this"""
|
|
from abc import ABC, abstractmethod
|
|
from pydantic import BaseModel, Extra, Field, root_validator
|
|
from typing import Any, Iterable, List, Optional
|
|
|
|
|
|
class BaseConnect(BaseModel, ABC):
|
|
type
|
|
driver: str
|
|
|
|
def get_session(self, db_name: str):
|
|
pass
|
|
|
|
def get_table_names(self) -> Iterable[str]:
|
|
pass
|
|
|
|
def get_table_info(self, table_names: Optional[List[str]] = None) -> str:
|
|
pass
|
|
|
|
def get_table_info(self, table_names: Optional[List[str]] = None) -> str:
|
|
pass
|
|
|
|
def get_index_info(self, table_names: Optional[List[str]] = None) -> str:
|
|
pass
|
|
|
|
def get_database_list(self):
|
|
pass
|
|
|
|
def run(self, session, command: str, fetch: str = "all") -> List:
|
|
pass
|