Skip to content

Commit

Permalink
convert to doris version.
Browse files Browse the repository at this point in the history
  • Loading branch information
grainyu committed Sep 28, 2023
1 parent c3344c6 commit ec188e0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion archery/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"phoenix",
"odps",
"cassandra",
"doris",
],
),
)
Expand Down Expand Up @@ -117,7 +118,7 @@
"mongo": {"path": "sql.engines.mongo:MongoEngine"},
"phoenix": {"path": "sql.engines.phoenix:PhoenixEngine"},
"odps": {"path": "sql.engines.odps:ODPSEngine"},
"starrocks": {"path": "sql.engines.starrocks:StarRocksEngine"},
"doris": {"path": "sql.engines.starrocks:StarRocksEngine"},
}
ENABLED_ENGINES = env("ENABLED_ENGINES")

Expand Down
8 changes: 4 additions & 4 deletions sql/engines/starrocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def get_connection(self, db_name=None):

@property
def name(self):
return "starrocks"
return "Doris"

@property
def info(self):
return "StarRocks engine"
return "Doris engine"

@property
def auto_backup(self):
Expand Down Expand Up @@ -79,7 +79,7 @@ def query(self, db_name=None, sql="", limit_num=0, close_conn=True, **kwargs):
result_set.rows = rows
result_set.affected_rows = len(rows)
except Exception as e:
logger.warning(f"StarRocks语句执行报错,语句:{sql},错误信息{e}")
logger.warning(f"Doris语句执行报错,语句:{sql},错误信息{e}")
result_set.error = str(e).split("Stack trace")[0]
finally:
if close_conn:
Expand Down Expand Up @@ -263,7 +263,7 @@ def execute(self, db_name=None, sql="", close_conn=True):
cursor.execute(statement)
cursor.close()
except Exception as e:
logger.warning(f"StarRocks语句执行报错,语句:{sql},错误信息{e}")
logger.warning(f"Doris语句执行报错,语句:{sql},错误信息{e}")
result.error = str(e).split("Stack trace")[0]
if close_conn:
self.close()
Expand Down
2 changes: 1 addition & 1 deletion sql/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Meta:
("clickhouse", "ClickHouse"),
("goinception", "goInception"),
("cassandra", "Cassandra"),
("starrocks", "StarRocks"),
("doris", "Doris"),
)


Expand Down
2 changes: 1 addition & 1 deletion sql/templates/sqlquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ <h4 class="modal-title text-danger">收藏语句</h4>
if (sql === 'explain') {
sqlContent = 'explain ' + sqlContent
}
} else if (optgroup === "StarRocks") {
} else if (optgroup === "Doris") {
//查看执行计划
if (sql === 'explain') {
sqlContent = 'explain ' + sqlContent
Expand Down
2 changes: 1 addition & 1 deletion sql/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def config(request):
# 获取所有实例标签
instance_tags = InstanceTag.objects.all()
# 支持自动审核的数据库类型
db_type = ["mysql", "oracle", "mongo", "clickhouse", "starrocks"]
db_type = ["mysql", "oracle", "mongo", "clickhouse", "doris"]
# 获取所有配置项
all_config = Config.objects.all().values("item", "value")
sys_config = {}
Expand Down

0 comments on commit ec188e0

Please sign in to comment.