Skip to content

Commit fa0b13b

Browse files
committed
fix: check sql only contain read operation
1 parent f9fb1f9 commit fa0b13b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/apps/db/db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ def exec_sql(ds: CoreDatasource | AssistantOutDsSchema, sql: str, origin_column=
592592
def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
593593
try:
594594
dialect = None
595-
if ds.type == "mysql" or ds.type == "doris" or ds.type == "starrocks":
595+
if equals_ignore_case(ds.type, 'mysql', 'doris', 'starrocks'):
596596
dialect = 'mysql'
597-
elif ds.type == "sqlServer":
597+
elif equals_ignore_case(ds.type, 'sqlServer'):
598598
dialect = 'tsql'
599599

600600
statements = sqlglot.parse(sql, dialect=dialect)

0 commit comments

Comments
 (0)