diff --git a/pilot/connections/base.py b/pilot/connections/base.py new file mode 100644 index 000000000..318ce17a2 --- /dev/null +++ b/pilot/connections/base.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- + +"""We need to design a base class. That other connector can Write with this""" + +class BaseConnection: + pass + diff --git a/pilot/connections/clickhouse.py b/pilot/connections/clickhouse.py new file mode 100644 index 000000000..23f2660f9 --- /dev/null +++ b/pilot/connections/clickhouse.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +class ClickHouseConnector: + """ClickHouseConnector""" + pass \ No newline at end of file diff --git a/pilot/connections/es.py b/pilot/connections/es.py new file mode 100644 index 000000000..819d85ecf --- /dev/null +++ b/pilot/connections/es.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + +class ElasticSearchConnector: + """ElasticSearchConnector""" + pass \ No newline at end of file diff --git a/pilot/connections/mongo.py b/pilot/connections/mongo.py new file mode 100644 index 000000000..b66aefdb3 --- /dev/null +++ b/pilot/connections/mongo.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +class MongoConnector: + """MongoConnector is a class which connect to mongo and chat with LLM""" + pass \ No newline at end of file diff --git a/pilot/connections/mysql_conn.py b/pilot/connections/mysql.py similarity index 85% rename from pilot/connections/mysql_conn.py rename to pilot/connections/mysql.py index 2dfff2ee7..acc59a144 100644 --- a/pilot/connections/mysql_conn.py +++ b/pilot/connections/mysql.py @@ -4,7 +4,11 @@ import pymysql class MySQLOperator: - """Connect MySQL Database fetch MetaData For LLM Prompt """ + """Connect MySQL Database fetch MetaData For LLM Prompt + Args: + + Usage: + """ default_db = ["information_schema", "performance_schema", "sys", "mysql"] def __init__(self, user, password, host="localhost", port=3306) -> None: @@ -26,6 +30,9 @@ class MySQLOperator: cursor.execute(_sql) results = cursor.fetchall() return results + + def get_index(self, schema_name): + pass def get_db_list(self): with self.conn.cursor() as cursor: @@ -38,5 +45,7 @@ class MySQLOperator: dbs = [d["Database"] for d in results if d["Database"] not in self.default_db] return dbs + def get_meta(self, schema_name): + pass diff --git a/pilot/connections/oracle.py b/pilot/connections/oracle.py new file mode 100644 index 000000000..4ce4e742a --- /dev/null +++ b/pilot/connections/oracle.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- + +class OracleConnector: + """OracleConnector""" + pass \ No newline at end of file diff --git a/pilot/connections/pg_conn.py b/pilot/connections/pg_conn.py deleted file mode 100644 index 1f776fc63..000000000 --- a/pilot/connections/pg_conn.py +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- \ No newline at end of file diff --git a/pilot/connections/postgres.py b/pilot/connections/postgres.py new file mode 100644 index 000000000..3e1df00ab --- /dev/null +++ b/pilot/connections/postgres.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + + + +class PostgresConnector: + """PostgresConnector is a class which Connector to chat with LLM""" + pass \ No newline at end of file diff --git a/pilot/connections/redis.py b/pilot/connections/redis.py new file mode 100644 index 000000000..ac00ade63 --- /dev/null +++ b/pilot/connections/redis.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- + + +class RedisConnector: + """RedisConnector""" + pass \ No newline at end of file