Skip to content

Commit 5004032

Browse files
committed
fix: check sql only contain read operation
1 parent e2af93e commit 5004032

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/apps/db/db.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@ def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
582582
dialect = None
583583
if ds.type == "mysql" or ds.type == "doris" or ds.type == "starrocks":
584584
dialect = 'mysql'
585+
elif ds.type == "sqlServer":
586+
dialect = 'tsql'
585587

586588
statements = sqlglot.parse(sql, dialect=dialect)
587589

0 commit comments

Comments
 (0)