文件最后提交记录最后更新时间
Redis添加会话管理支持 (#2816) 1 年前
add cassandra support (#2230) * add cassandra draft add cassandra integration test 重构 engine 的代码, 改为动态加载 * add more cassandra tests * fix data dictionary tests * more tests in cassandra * add cassandra in readme2 年前
补齐一些获取用户名密码的代码 (#2918) 1 年前
fix cassandra frontend bug (#2240) * fix cassandra frontend bug * fix cassandra test * fix type define error2 年前
解决clickhouse表名大小写敏感问题 (#2637) * 解决clickhouse表名大小写敏感问题 解决clickhouse表名大小写敏感问题 * 单元测试1 年前
doris支持会话管理功能 (#2984) * doris支持会话管理功能 * lint fix * 移除废弃注释和测试 --------- Co-authored-by: hhyo <rtttte@qq.com>7 个月前
dashboard及审批流审批人展示优化 (#2932) 1 年前
MySQL查询语句权限Bug修复 (#2778) * 添加favicon图片 * firset * 修改 * 撤销 * 修复权限错误 --------- Co-authored-by: 王飞 <fei.wang@xgo.one>1 年前
新引擎: Memcached 支持 (#3057) * feat(engines): add memcahed * style: reformat code * style: reformat code * tests: add test cases for memcached * style: remove unused line * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(engine): memcached engine spilit query and execute commands * feat(engine): memcached remove useless functions and test case --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>6 个月前
mysql查询支持将Binary格式转换为HEX展示 (#1839) * mysql查询支持将Binary格式转换为HEX展示 #17723 年前
fix Mongodb updateOne、insertOne、insertMany、updateMany (#3023) * fix mongoDB json decode error in SQL上線 * fix lint * fix lint * remove Mongo unused function * fix insert with BulkWriteResult and WriteResult * fix mongoDB update * fix typo error * typo error * fix lint --------- Co-authored-by: 小圈圈 <rtttte@qq.com>7 个月前
fix black (#2493) 2 年前
doris支持会话管理功能 (#2984) * doris支持会话管理功能 * lint fix * 移除废弃注释和测试 --------- Co-authored-by: hhyo <rtttte@qq.com>7 个月前
add cassandra support (#2230) * add cassandra draft add cassandra integration test 重构 engine 的代码, 改为动态加载 * add more cassandra tests * fix data dictionary tests * more tests in cassandra * add cassandra in readme2 年前
优化(oracle.py):Oracle数据字典-表信息-添加索引字段展示-修改列名排序 (#3040) 8 个月前
修复PG查询json字段转码中文显示不正常问题 (#3035) * 修复PG查询时将json或jsonb字段类型转换成字符串后中文显示不正常问题 * fix lint --------- Co-authored-by: 小圈圈 <rtttte@qq.com>7 个月前
fix black (#2493) 2 年前
feat(redis): add hlen command for redis (#2957) feat(redis): add hlen command which has O(1) time complexity1 年前
fix cassandra frontend bug (#2240) * fix cassandra frontend bug * fix cassandra test * fix type define error2 年前
doris支持会话管理功能 (#2984) * doris支持会话管理功能 * lint fix * 移除废弃注释和测试 --------- Co-authored-by: hhyo <rtttte@qq.com>7 个月前
ES与OpenSearch重构数据库列表及表列表-v0.8-beta (#2780) 1 年前
新引擎: Memcached 支持 (#3057) * feat(engines): add memcahed * style: reformat code * style: reformat code * tests: add test cases for memcached * style: remove unused line * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(engine): memcached engine spilit query and execute commands * feat(engine): memcached remove useless functions and test case --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>6 个月前
Fix: mongodb 用不了count统计 (#2991) 11 个月前
MySQL数据字典结果增加排序 (#2745) 1 年前
ES与OpenSearch重构数据库列表及表列表-v0.8-beta (#2780) 1 年前
优化(oracle.py):Oracle数据字典-表信息-添加索引字段展示-修改列名排序 (#3040) 8 个月前
Readme.md

Engine 说明

Cassandra

当前连接时, 使用参数基本为写死参数, 具体可以参照代码.

如果需要覆盖, 可以自行继承

具体方法为:

  1. 新增一个文件夹extras在根目录, 和sql, sql_api等文件夹平级 可以docker 打包时加入, 也可以使用卷挂载的方式
  2. 新增一个文件, mycassandra.py
from sql.engines.cassandra import CassandraEngine

class MyCassandraEngine(CassandraEngine):
    def get_connection(self, db_name=None):
        db_name = db_name or self.db_name
        if self.conn:
            if db_name:
                self.conn.execute(f"use {db_name}")
            return self.conn
        hosts = self.host.split(",")
        # 在这里更改你获取 session 的方式
        auth_provider = PlainTextAuthProvider(
            username=self.user, password=self.password
        )
        cluster = Cluster(hosts, port=self.port, auth_provider=auth_provider,
                          load_balancing_policy=RoundRobinPolicy(), protocol_version=5)
        self.conn = cluster.connect(keyspace=db_name)
        # 下面这一句最好是不要动.
        self.conn.row_factory = tuple_factory
        return self.conn
  1. 修改settings , 加载你刚写的 engine
AVAILABLE_ENGINES = {
    "mysql": {"path": "sql.engines.mysql:MysqlEngine"},
    # 这里改成你的 engine
    "cassandra": {"path": "extras.mycassandra:MyCassandraEngine"},
    "clickhouse": {"path": "sql.engines.clickhouse:ClickHouseEngine"},
    "goinception": {"path": "sql.engines.goinception:GoInceptionEngine"},
    "mssql": {"path": "sql.engines.mssql:MssqlEngine"},
    "redis": {"path": "sql.engines.redis:RedisEngine"},
    "pqsql": {"path": "sql.engines.pgsql:PgSQLEngine"},
    "oracle": {"path": "sql.engines.oracle:OracleEngine"},
    "mongo": {"path": "sql.engines.mongo:MongoEngine"},
    "phoenix": {"path": "sql.engines.phoenix:PhoenixEngine"},
    "odps": {"path": "sql.engines.odps:ODPSEngine"},
}